mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04: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;
|
unsigned consumed = 0;
|
||||||
uintmax_t dv = mult;
|
uintmax_t dv = mult;
|
||||||
if(decimal <= val || val == 0){
|
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)){
|
while((val / decimal) >= dv && consumed < sizeof(prefixes) / sizeof(*prefixes)){
|
||||||
dv *= mult;
|
dv *= mult;
|
||||||
++consumed;
|
++consumed;
|
||||||
|
@ -1233,7 +1233,7 @@ notcurses_early_init(const struct notcurses_options* opts, FILE* fp, unsigned* u
|
|||||||
free(ret);
|
free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if(utf8){
|
if(*utf8){
|
||||||
ncmetric_use_utf8();
|
ncmetric_use_utf8();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user