]> granicus.if.org Git - file/commitdiff
Use sizeof instead of array length from Charles Longeau
authorChristos Zoulas <christos@zoulas.com>
Sun, 18 May 2008 23:21:17 +0000 (23:21 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 18 May 2008 23:21:17 +0000 (23:21 +0000)
src/file.c

index 89d163284b7582371fcc384896d0f1505d7aaf96..2aa2abd6023d44931aa188672aef679d66c6eaca 100644 (file)
@@ -70,7 +70,7 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc
 #include "patchlevel.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: file.c,v 1.119 2008/02/07 00:58:52 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.120 2008/05/18 23:21:17 christos Exp $")
 #endif /* lint */
 
 
@@ -375,7 +375,7 @@ unwrap(char *fn)
                        exit(1);
                }
 
-               while (fgets(buf, MAXPATHLEN, f) != NULL) {
+               while (fgets(buf, sizeof(buf), f) != NULL) {
                        buf[strcspn(buf, "\n")] = '\0';
                        cwid = file_mbswidth(buf);
                        if (cwid > wid)