From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id 916B4382E80F for ; Tue, 2 Feb 2021 00:37:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 916B4382E80F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ldv@altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id DDFC372C8B1 for ; Tue, 2 Feb 2021 03:37:11 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id CC6C47CC8A3; Tue, 2 Feb 2021 03:37:11 +0300 (MSK) Date: Tue, 2 Feb 2021 03:37:11 +0300 From: "Dmitry V. Levin" To: libc-alpha@sourceware.org Cc: Vitaly Chikunov Subject: Re: [PATCH] libSegFault: Fix printing signal number [BZ #27249] Message-ID: <20210202003711.GD28363@altlinux.org> References: <20210201200408.1030278-1-vt@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 00:37:14 -0000 On Mon, Feb 01, 2021 at 06:00:30PM -0300, Adhemerval Zanella via Libc-alpha wrote: > 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 Applied, thanks! > > --- > > 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); > > } -- ldv