about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-12-13 20:08:06 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-12-13 20:08:06 +0100
commitd25bfe3cfb6b798b388c0f8bd865377ed2f14b56 (patch)
tree6465c869f94e1e761543218ede8f569f29354d4b
parent5b0de797fd0249067fe06bf193cc22de50b4b47a (diff)
downloadrnl-d25bfe3cfb6b798b388c0f8bd865377ed2f14b56.tar.gz
rnl-d25bfe3cfb6b798b388c0f8bd865377ed2f14b56.tar.xz
rnl-d25bfe3cfb6b798b388c0f8bd865377ed2f14b56.zip
pipe mode: use off_t for counting too
-rw-r--r--rnl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rnl.c b/rnl.c
index b1bac2a..b23abbb 100644
--- a/rnl.c
+++ b/rnl.c
@@ -13,7 +13,7 @@ int
 main(int argc, char *argv[])
 {
 	int c;
-	int i, n = 0;
+	int i;
 	int mode = -1;
 	char nl = '\n';
 
@@ -37,6 +37,7 @@ main(int argc, char *argv[])
 
 	if (optind == argc) {
 		/* pipe mode stdin -> stdout */
+		off_t n = 0;
 
 		while ((c = getchar()) != EOF) {
 			if (c == nl) {
@@ -53,7 +54,7 @@ main(int argc, char *argv[])
 				putchar(nl);
 		else if (mode == -1 && n > 0)
 			putchar(nl);
-		/* else (mode == 0) ; do nothing */
+		/* else (mode == 0) ; noop */
 
 		return 0;
 	}