shithub: scc

Download patch

ref: 65120a98fb3d4d914f79cc66dc425d7d4d81c666
parent: 0e3916924910843d4edb4fa7795e8b9476ed9e54
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Feb 10 16:43:51 EST 2019

[ar] Remove unneded variable

--- a/src/cmd/ar.c
+++ b/src/cmd/ar.c
@@ -110,7 +110,6 @@
 archive(char *pname, FILE *to, char letter)
 {
 	int c;
-	size_t n;
 	FILE *from;
 	char mtime[13], *fname;
 	struct fprop prop;
@@ -133,9 +132,10 @@
 	        prop.gid,
 	        prop.mode,
 	        prop.size);
-	for (n = 0; (c = getc(from)) != EOF; n++)
+
+	while ((c = getc(from)) != EOF)
 		putc(c, to);
-	if (n & 1)
+	if (prop.size & 1)
 		putc('\n', to);
 	if (ferror(from))
 		error("reading input '%s': %s", pname, errstr());