Commit 9688d20ad63057dfb1047a7c31d629b07d92618b

Stefan Sperling 2019-10-09T08:02:04

rename local variable in diff3.c's edscript() from j to len (not a loop index)

diff --git a/lib/diff3.c b/lib/diff3.c
index cf6d63f..c22d2b2 100644
--- a/lib/diff3.c
+++ b/lib/diff3.c
@@ -926,7 +926,7 @@ static const struct got_error *
 edscript(int n, struct diff3_state *d3s)
 {
 	const struct got_error *err = NULL;
-	int j, k;
+	int len, k;
 	char block[BUFSIZ+1];
 
 	for (; n > 0; n--) {
@@ -944,11 +944,11 @@ edscript(int n, struct diff3_state *d3s)
 		    == -1)
 			return got_error_from_errno("fseek");
 		k = d3s->de[n].new.to - d3s->de[n].new.from;
-		for (; k > 0; k -= j) {
-			j = k > BUFSIZ ? BUFSIZ : k;
-			if (fread(block, 1, j, d3s->fp[2]) != (size_t)j)
+		for (; k > 0; k -= len) {
+			len = k > BUFSIZ ? BUFSIZ : k;
+			if (fread(block, 1, len, d3s->fp[2]) != (size_t)len)
 				return got_ferror(d3s->fp[2], GOT_ERR_IO);
-			block[j] = '\0';
+			block[len] = '\0';
 			err = diff_output(d3s->diffbuf, "%s", block);
 			if (err)
 				return err;