Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-06-27 21:44:36 +1000
committerDan McGee <dan@archlinux.org>2010-07-07 07:24:57 -0500
commit60de8ec932984f1374501c3f11ad1bcfba5c7d5c (patch)
tree9b81e0d4f8fce2df996ecc5cef4010dcefa61ec3 /lib/libalpm/trans.c
parent686b8c146398c5ba9feee2c1fa10bf9e598b2ce8 (diff)
Check return value of fgets calls
Prevents compiler warnings with -D_FORTIFY_SOURCE=2 Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index c042f099..523f33b8 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -324,8 +324,7 @@ static int grep(const char *fn, const char *needle)
while(!feof(fp)) {
char line[1024];
int sline = sizeof(line)-1;
- fgets(line, sline, fp);
- if(feof(fp)) {
+ if(fgets(line, sline, fp) == NULL) {
continue;
}
if(strstr(line, needle)) {