From f9be44c7e6d90cb1fe3a0fbe3cc299ac783f0be8 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Mon, 1 Feb 2021 23:04:08 +0300 Subject: [PATCH] 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 --- debug/segfault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug/segfault.c b/debug/segfault.c index 0a6be8b9d4..1873022db9 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); } -- 2.43.5