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