properly check for utf8 for calling ncmetric_use_utf8() closes #2834

This commit is contained in:
nick black 2025-01-10 02:53:12 -05:00
parent 9f294e0153
commit 73a7190b80
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;