top: try to avoid premature truncation indicator ('+')
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
3aa348ad77
commit
0f54ff181a
@ -1472,7 +1472,7 @@ static inline const char *make_str_utf8 (const char *str, int width, int justr,
|
||||
static char buf[SCREENMAX];
|
||||
int delta = utf8_delta(str);
|
||||
|
||||
if (width + delta <= snprintf(buf, sizeof(buf), "%s", str)) {
|
||||
if (width + delta < snprintf(buf, sizeof(buf), "%s", str)) {
|
||||
snprintf(buf, sizeof(buf), "%.*s", utf8_embody(str, width - 1), str);
|
||||
delta = utf8_delta(buf);
|
||||
buf[width + delta - 1] = COLPLUSCH;
|
||||
|
Loading…
Reference in New Issue
Block a user