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(-)
From ed8a781460dab6c0931dd77f1921211471e38c72 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Wed, 14 Aug 2019 18:06:21 -0700
Subject: [PATCH] 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(-)
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);
--
2.23.0.rc1.153.gdeed80330f-goog
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net