summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2016-08-10 15:01:31 +0100
committerFlorian Festi <ffesti@redhat.com>2016-08-24 13:56:17 +0200
commit3910b1d1cfd0205b0f6f1a044a287d6bfdd351b2 (patch)
tree7ded667f76de1ae867e4a1c65f933b664e25b331
parentcf5679397f36710a942fcb83a63c690eb25d72af (diff)
downloadrpm-3910b1d1cfd0205b0f6f1a044a287d6bfdd351b2.tar.gz
build: fgetc returns int, not char.
Returning the value into a char is a mistake on all platforms, but is particularly bad on RISC-V. On that platform (like ARM) char is unsigned. Therefore EOF (-1) is returned as 255, and the subsequent test 'c == EOF' ('255 == -1') fails causing an infinite loop. Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
-rw-r--r--build/parseSpec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 85b0ba3de..28f00bc18 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -323,7 +323,7 @@ retry:
/* Make sure we have something in the read buffer */
if (!(ofi->readPtr && *(ofi->readPtr))) {
- char c;
+ int c;
int i = 0;
while((c = fgetc(ofi->fp)) != EOF) {