Module Name: src
Committed By: lukem
Date: Tue Apr 14 07:54:52 UTC 2009
Modified Files:
src/usr.bin/wall: wall.c
Log Message:
Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/wall/wall.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/wall/wall.c
diff -u src/usr.bin/wall/wall.c:1.27 src/usr.bin/wall/wall.c:1.28
--- src/usr.bin/wall/wall.c:1.27 Sun Feb 15 06:06:55 2009
+++ src/usr.bin/wall/wall.c Tue Apr 14 07:54:51 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: wall.c,v 1.27 2009/02/15 06:06:55 dholland Exp $ */
+/* $NetBSD: wall.c,v 1.28 2009/04/14 07:54:51 lukem Exp $ */
/*
* Copyright (c) 1988, 1990, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93";
#endif
-__RCSID("$NetBSD: wall.c,v 1.27 2009/02/15 06:06:55 dholland Exp $");
+__RCSID("$NetBSD: wall.c,v 1.28 2009/04/14 07:54:51 lukem Exp $");
#endif /* not lint */
/*
@@ -198,8 +198,8 @@
time_t now;
FILE *fp;
int fd;
- const char *whom;
- char *p, *tty, tmpname[MAXPATHLEN], lbuf[100],
+ const char *whom, *tty;
+ char *p, tmpname[MAXPATHLEN], lbuf[100],
hostname[MAXHOSTNAMELEN+1];
(void)snprintf(tmpname, sizeof tmpname, "%s/wall.XXXXXX", _PATH_TMP);
@@ -257,7 +257,7 @@
if (fstat(fd, &sbuf))
err(1, "can't stat temporary file");
- if (sbuf.st_size > SIZE_T_MAX)
+ if ((uint64_t)sbuf.st_size > SIZE_T_MAX)
errx(1, "file too big");
mbufsize = sbuf.st_size;
if (!(mbuf = malloc(mbufsize)))