mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-08 23:59:02 -05:00
properly check for utf8 for calling ncmetric_use_utf8() closes #2834
This commit is contained in:
parent
9f294e0153
commit
73a7190b80
@ -41,7 +41,7 @@ const char* ncnmetric(uintmax_t val, size_t s, uintmax_t decimal,
|
||||
unsigned consumed = 0;
|
||||
uintmax_t dv = mult;
|
||||
if(decimal <= val || val == 0){
|
||||
// FIXME verify that input < 2^89, wish we had static_assert() :/
|
||||
// FIXME verify that input < 2^89
|
||||
while((val / decimal) >= dv && consumed < sizeof(prefixes) / sizeof(*prefixes)){
|
||||
dv *= mult;
|
||||
++consumed;
|
||||
|
@ -1233,7 +1233,7 @@ notcurses_early_init(const struct notcurses_options* opts, FILE* fp, unsigned* u
|
||||
free(ret);
|
||||
return NULL;
|
||||
}
|
||||
if(utf8){
|
||||
if(*utf8){
|
||||
ncmetric_use_utf8();
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user