1 From 0c44e5cdbdc525cc1bf1063b6c561efa23d06b0d Mon Sep 17 00:00:00 2001
2 From: "Richard W.M. Jones" <rjones@redhat.com>
3 Date: Wed, 10 Aug 2016 15:01:31 +0100
4 Subject: [PATCH 3/4] build: fgetc returns int, not char.
6 Returning the value into a char is a mistake on all platforms, but is
7 particularly bad on RISC-V. On that platform (like ARM) char is
8 unsigned. Therefore EOF (-1) is returned as 255, and the subsequent
9 test 'c == EOF' ('255 == -1') fails causing an infinite loop.
11 Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
13 build/parseSpec.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
16 diff --git a/build/parseSpec.c b/build/parseSpec.c
17 index 85b0ba3..28f00bc 100644
18 --- a/build/parseSpec.c
19 +++ b/build/parseSpec.c
20 @@ -323,7 +323,7 @@ retry:
22 /* Make sure we have something in the read buffer */
23 if (!(ofi->readPtr && *(ofi->readPtr))) {
28 while((c = fgetc(ofi->fp)) != EOF) {