about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index e6eb69f01..0e8404209 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -519,7 +519,16 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
 	    if (widthp)
 		*widthp = 6;
 	} else {
-	    return nicechar((int)c);
+	    strcpy(buf, nicechar((int)c));
+	    /*
+	     * There may be metafied characters from nicechar(),
+	     * so compute width and end position independently.
+	     */
+	    if (widthp)
+		*widthp = ztrlen(buf);
+	    if (swidep)
+	      *swidep = buf + strlen(buf);
+	    return buf;
 	}
 	if (swidep)
 	    *swidep = buf + *widthp;