From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14837 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "wangjianjian (C)" Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH V2 1/1] ungetc: Cast to unsigned char before returning Date: Sun, 20 Oct 2019 04:43:02 +0000 Message-ID: <87f051899d0a49f1aa66f5a39c2a9100@huawei.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="270203"; mail-complaints-to="usenet@blaine.gmane.org" To: "musl@lists.openwall.com" Original-X-From: musl-return-14853-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 20 06:43:20 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iM33m-001894-TR for gllmg-musl@m.gmane.org; Sun, 20 Oct 2019 06:43:19 +0200 Original-Received: (qmail 17803 invoked by uid 550); 20 Oct 2019 04:43:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17766 invoked from network); 20 Oct 2019 04:43:15 -0000 Thread-Topic: [PATCH V2 1/1] ungetc: Cast to unsigned char before returning Thread-Index: AdWHAL0OK9cJXtVtRGaaH7qDilhzWQ== Accept-Language: en-US Content-Language: zh-CN x-originating-ip: [10.111.171.229] X-CFilter-Loop: Reflected Xref: news.gmane.org gmane.linux.lib.musl.general:14837 Archived-At: Per Posix and ISO-C standard, casting to unsigned char is needed before returning. Signed-off-by: Wang Jianjian --- src/stdio/ungetc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdio/ungetc.c b/src/stdio/ungetc.c index 180673a4..bc629d4c 100644 --- a/src/stdio/ungetc.c +++ b/src/stdio/ungetc.c @@ -16,5 +16,5 @@ int ungetc(int c, FILE *f) f->flags &=3D ~F_EOF; FUNLOCK(f); - return c; + return (unsigned char)c; } -- 2.17.1 BR, Wang Jianjian