Commit 9516e7cb563b98e29f9d23f65189f9e5b583c04c

Stefan Sperling 2019-08-11T18:38:52

fix getline(3) return value check in show_change(); from Hiltjo Posthuma

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index e30bb0b..9b09952 100644
--- a/got/got.c
+++ b/got/got.c
@@ -3188,7 +3188,7 @@ show_change(unsigned char status, const char *path, FILE *patch_file, int n,
 		if (fseek(patch_file, 0L, SEEK_SET) == -1)
 			return got_error_from_errno("fseek");
 		printf(GOT_COMMIT_SEP_STR);
-		while ((linelen = getline(&line, &linesize, patch_file) != -1))
+		while ((linelen = getline(&line, &linesize, patch_file)) != -1)
 			printf("%s", line);
 		if (ferror(patch_file))
 			return got_error_from_errno("getline");