From 7be8f6224ecc25eecb2bafd17b64dd84a1088492 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 14 Aug 2019 18:06:21 -0700 Subject: linestack.c: fix buffer length. GCC 8.2 (which my laptop appears to have been quietly upgraded to) points out that the %04X of an int might actually take 8 characters; between that, the "U+", and the trailing NUL, we're gonna need a bigger boat... --- lib/linestack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/linestack.c b/lib/linestack.c index fb6cc1e4..0fc83e6b 100644 --- a/lib/linestack.c +++ b/lib/linestack.c @@ -125,7 +125,7 @@ int crunch_str(char **str, int width, FILE *out, char *escmore, // standard escapes: ^X if <32, if invalid UTF8, U+XXXX if UTF8 !iswprint() int crunch_escape(FILE *out, int cols, int wc) { - char buf[8]; + char buf[11]; int rc; if (wc<' ') rc = sprintf(buf, "^%c", '@'+wc); -- cgit v1.2.3