The following diff improves type consistency in wc: the return type of
read() is ssize_t, so the type of 'len' should be ssize_t too. There is
no reason for it to be an int.

Nicolas Bedos


Index: src/usr.bin/wc/wc.c
===================================================================
RCS file: /cvs/src/usr.bin/wc/wc.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 wc.c
--- src/usr.bin/wc/wc.c 27 Nov 2013 13:32:02 -0000      1.16
+++ src/usr.bin/wc/wc.c 9 Oct 2014 20:31:37 -0000
@@ -111,7 +111,7 @@ cnt(char *file)
 {
        u_char *C;
        short gotsp;
-       int len;
+       ssize_t len;
        int64_t linect, wordct, charct;
        struct stat sbuf;
        int fd;

Reply via email to