Skip to content

Commit

Permalink
properly check for utf8 for calling ncmetric_use_utf8() closes #2834
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Jan 10, 2025
1 parent 9f294e0 commit 73a7190
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/metric.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/notcurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 73a7190

Please sign in to comment.