public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] libSegFault: Fix printing signal number [BZ #27249]
Date: Mon, 1 Feb 2021 18:00:30 -0300	[thread overview]
Message-ID: <b98190ce-1076-ec20-3ece-1344ec236451@linaro.org> (raw)
In-Reply-To: <20210201200408.1030278-1-vt@altlinux.org>



On 01/02/2021 17:04, Vitaly Chikunov wrote:
> Signal number is written into the tail of buf, but printed from the
> beginning, outputting garbage on the screen. Print from the correct
> position.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

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

  reply	other threads:[~2021-02-01 21:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 20:04 Vitaly Chikunov
2021-02-01 21:00 ` Adhemerval Zanella [this message]
2021-02-02  0:37   ` Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b98190ce-1076-ec20-3ece-1344ec236451@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).