From: Vitaly Chikunov Date: Mon, 1 Feb 2021 20:04:08 +0000 (+0300) Subject: libSegFault: Fix printing signal number [BZ #27249] X-Git-Tag: upstream/2.34~995 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8;p=platform%2Fupstream%2Fglibc.git libSegFault: Fix printing signal number [BZ #27249] Signal number is written into the tail of buf, but printed from the beginning, outputting garbage on the screen. Fix this by printing from the correct position. Reviewed-by: Adhemerval Zanella Reviewed-by: Dmitry V. Levin --- diff --git a/debug/segfault.c b/debug/segfault.c index 0a6be8b..1873022 100644 --- a/debug/segfault.c +++ b/debug/segfault.c @@ -58,7 +58,7 @@ write_strsignal (int fd, int signal) char buf[30]; char *ptr = _itoa_word (signal, &buf[sizeof (buf)], 10, 0); WRITE_STRING ("signal "); - write (fd, buf, &buf[sizeof (buf)] - ptr); + write (fd, ptr, &buf[sizeof (buf)] - ptr); }