summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2010-04-04 16:15:43 -0400
committerMadCamel <madcamel@gmail.com>2010-04-04 16:15:43 -0400
commitb683a1ba9ba9e46bab0d8f94e38ef56669f8530a (patch)
treec90685468d3a67f4f2dc98d72b1d23d0745ad693 /src/map/npc.c
parent3db7c2cd1c4fb0d8888416e9b5733abab574ebe9 (diff)
downloadtmwa-b683a1ba9ba9e46bab0d8f94e38ef56669f8530a.tar.gz
tmwa-b683a1ba9ba9e46bab0d8f94e38ef56669f8530a.tar.bz2
tmwa-b683a1ba9ba9e46bab0d8f94e38ef56669f8530a.tar.xz
tmwa-b683a1ba9ba9e46bab0d8f94e38ef56669f8530a.zip
Fixed some bad code that was generating compiler warnings
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index edbf548..ab0e7ff 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1543,7 +1543,8 @@ static int npc_parse_script (char *w1, char *w2, char *w3, char *w4,
for (i = strlen (srcbuf) - 1; i >= 0 && isspace (srcbuf[i]); i--);
if (i >= 0 && srcbuf[i] == '}')
break;
- fgets (line, 1020, fp);
+ if (!fgets (line, 1020, fp))
+ break;
(*lines)++;
if (feof (fp))
break;
@@ -1827,7 +1828,8 @@ static int npc_parse_function (char *w1, char *w2, char *w3, char *w4,
for (i = strlen (srcbuf) - 1; i >= 0 && isspace (srcbuf[i]); i--);
if (i >= 0 && srcbuf[i] == '}')
break;
- fgets (line, 1020, fp);
+ if (!fgets (line, 1020, fp))
+ break;
(*lines)++;
if (feof (fp))
break;