Module Name: src
Committed By: lukem
Date: Sun Apr 12 14:01:20 UTC 2009
Modified Files:
src/usr.bin/look: look.c
Log Message:
Fix WARNS=4 issues
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/look/look.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/look/look.c
diff -u src/usr.bin/look/look.c:1.12 src/usr.bin/look/look.c:1.13
--- src/usr.bin/look/look.c:1.12 Mon Jul 21 14:19:24 2008
+++ src/usr.bin/look/look.c Sun Apr 12 14:01:20 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: look.c,v 1.12 2008/07/21 14:19:24 lukem Exp $ */
+/* $NetBSD: look.c,v 1.13 2009/04/12 14:01:20 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)look.c 8.2 (Berkeley) 5/4/95";
#endif
-__RCSID("$NetBSD: look.c,v 1.12 2008/07/21 14:19:24 lukem Exp $");
+__RCSID("$NetBSD: look.c,v 1.13 2009/04/12 14:01:20 lukem Exp $");
#endif /* not lint */
/*
@@ -101,7 +101,8 @@
{
struct stat sb;
int ch, fd, termchar;
- char *back, *file, *front, *string, *p;
+ char *back, *front, *string, *p;
+ const char *file;
string = NULL;
file = _PATH_WORDS;
@@ -142,7 +143,7 @@
if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
err(2, "%s", file);
- if (sb.st_size > SIZE_T_MAX)
+ if (sb.st_size > (off_t)SIZE_T_MAX)
err(2, "%s: %s", file, strerror(EFBIG));
if ((front = mmap(NULL, (size_t)sb.st_size,
PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0)) == NULL)