Browse Source

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 <adhemerval.zanella@linaro.org>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
tuliom/microwatt
Vitaly Chikunov 5 years ago
committed by Dmitry V. Levin
parent
commit
f9be44c7e6
  1. 2
      debug/segfault.c

2
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);
}

Loading…
Cancel
Save