aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-08-14 18:06:21 -0700
committerRob Landley <rob@landley.net>2019-08-15 05:40:47 -0500
commit7be8f6224ecc25eecb2bafd17b64dd84a1088492 (patch)
tree4333caef30b9c20504c9e97d7039946d9fb6bc42
parent168c9820628f9ebc447904cb68e54b042e3bcfba (diff)
downloadtoybox-7be8f6224ecc25eecb2bafd17b64dd84a1088492.tar.gz
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...
-rw-r--r--lib/linestack.c2
1 files changed, 1 insertions, 1 deletions
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, <XX> 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);