summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 523f33b8..3c5141a1 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -323,10 +323,11 @@ static int grep(const char *fn, const char *needle)
}
while(!feof(fp)) {
char line[1024];
- int sline = sizeof(line)-1;
- if(fgets(line, sline, fp) == NULL) {
+ if(fgets(line, sizeof(line), fp) == NULL) {
continue;
}
+ /* TODO: this will not work if the search string
+ * ends up being split across line reads */
if(strstr(line, needle)) {
fclose(fp);
return(1);