Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Sun, 20 Oct 2019 04:43:02 +0000
From: "wangjianjian (C)" <wangjianjian3@...wei.com>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: [PATCH V2 1/1] ungetc: Cast to unsigned char before returning

Per Posix and ISO-C standard, casting to unsigned char is needed before
returning.

Signed-off-by: Wang Jianjian <wangjianjian3@...wei.com>
---
 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 &= ~F_EOF;

        FUNLOCK(f);
-       return c;
+       return (unsigned char)c;
 }
--
2.17.1

BR,
Wang Jianjian


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.