projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
e449d74
)
Fix EOF detection in PGN parser
author
H.G.Muller
<hgm@hgm-xboard.(none)>
Sun, 24 Apr 2016 19:10:06 +0000 (21:10 +0200)
committer
H.G.Muller
<hgm@hgm-xboard.(none)>
Sun, 24 Apr 2016 19:10:06 +0000 (21:10 +0200)
The result of fgetc was stored in a (char) before comparing it with EOF,
which fails badly if the char is not signed.
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
8378132
..
4c634ca
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-285,7
+285,7
@@
KifuMove (char **p)
int
ReadLine ()
{ // Read one line from the input file, and append to the buffer
- char c, *start = inPtr;
+ int c; char *start = inPtr;
if(fromString) return 0; // parsing string, so the end is a hard end
if(!inputFile) return 0;
while((c = fgetc(inputFile)) != EOF) {