summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/utils.c b/Src/utils.c
index ce1a78218..c0081f8e1 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -552,8 +552,12 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
     if (swidep)
 	*swidep = s;
     for (mbptr = mbstr; ret; s++, mbptr++, ret--) {
+	DPUTS(s >= buf + NICECHAR_MAX,
+	      "BUG: buffer too small in wcs_nicechar");
 	if (imeta(*mbptr)) {
 	    *s++ = Meta;
+	    DPUTS(s >= buf + NICECHAR_MAX,
+		  "BUG: buffer too small for metafied char in wcs_nicechar");
 	    *s = *mbptr ^ 32;
 	} else {
 	    *s = *mbptr;