projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a85a44
)
Dont assume error if fgets returns NULL
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 16 Feb 2009 22:05:31 +0000
(23:05 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 16 Feb 2009 22:05:31 +0000
(23:05 +0100)
client/client.c
patch
|
blob
|
history
diff --git
a/client/client.c
b/client/client.c
index
5126d97
..
93741ca
100644
(file)
--- a/
client/client.c
+++ b/
client/client.c
@@
-3547,16
+3547,12
@@
int cmd_source(const char* arg, int echo )
return -1;
}
- while (!feof(includeFile)) {
- memset(line, 0, sizeof(line));
- if (!fgets(line, sizeof(line), includeFile))
- {
- perror("fgets");
- break;
- }
-
- if (strlen(line) < 2) continue;
- if (line[0] == '#') continue;
+ while (fgets(line, sizeof(line), includeFile))
+ {
+ if (strlen(line) < 2)
+ continue;
+ if (line[0] == '#')
+ continue;
if ((cp = strrchr(line, '\n')))
*cp = '\0';