diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2018-11-20 23:12:32 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2018-11-20 23:31:54 +0100 |
commit | a86b0c40d3445550f45e037604c8c784c776091e (patch) | |
tree | 5b5412ebc3eb71db4f85d9ee13370d2214849dca | |
parent | 2c816e5bc74f0fc5708f7b07ea5934f0e5d333e8 (diff) | |
download | screen-a86b0c40d3445550f45e037604c8c784c776091e.tar.gz |
get rid of Wformat-overflow warning
60 characters is plenty enough for reason string
window.c: In function ‘WindowDied’:
window.c:1941:33: warning: ‘%s’ directive writing up to 99 bytes into a region of size 86 [-Wformat-overflow=]
sprintf(buf, "\n\r=== Command %s (%s) ===", reason, s ? s : "?");
^~ ~~~~~~
window.c:1941:16: note: assuming directive output of 1 byte
sprintf(buf, "\n\r=== Command %s (%s) ===", reason, s ? s : "?");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862,
from logfile.h:33,
from window.h:39,
from window.c:34:
/usr/include/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output 22 or more bytes (assuming 122) into a destination of size 100
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r-- | src/window.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index 88f4136..a54c0ce 100644 --- a/src/window.c +++ b/src/window.c @@ -1902,7 +1902,7 @@ void WindowDied(Window *p, int wstat, int wstat_valid) killit = 1; if (ZombieKey_destroy && !killit) { - char buf[100], *s, reason[100]; + char buf[100], *s, reason[60]; time_t now; if (wstat_valid) { |