Module Name: src
Committed By: lukem
Date: Sat Apr 11 13:01:27 UTC 2009
Modified Files:
src/usr.bin/deroff: deroff.c
Log Message:
fix -Wsign-compare issues
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/deroff/deroff.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/deroff/deroff.c
diff -u src/usr.bin/deroff/deroff.c:1.5 src/usr.bin/deroff/deroff.c:1.6
--- src/usr.bin/deroff/deroff.c:1.5 Sat Dec 15 19:44:50 2007
+++ src/usr.bin/deroff/deroff.c Sat Apr 11 13:01:27 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: deroff.c,v 1.5 2007/12/15 19:44:50 perry Exp $ */
+/* $NetBSD: deroff.c,v 1.6 2009/04/11 13:01:27 lukem Exp $ */
/* taken from: OpenBSD: deroff.c,v 1.6 2004/06/02 14:58:46 tom Exp */
@@ -74,13 +74,14 @@
#if 0
static const char sccsid[] = "@(#)deroff.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$NetBSD: deroff.c,v 1.5 2007/12/15 19:44:50 perry Exp $";
+static const char rcsid[] = "$NetBSD: deroff.c,v 1.6 2009/04/11 13:01:27 lukem Exp $";
#endif
#endif /* not lint */
#include <sys/cdefs.h>
#include <err.h>
#include <limits.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -436,7 +437,8 @@
while (C == ' ')
; /* nothing */
- for (p = fname ; p - fname < sizeof(fname) && (*p = c) != '\n' &&
+ for (p = fname ; p - fname < (ptrdiff_t)sizeof(fname) &&
+ (*p = c) != '\n' &&
c != ' ' && c != '\t' && c != '\\'; ++p)
C;
*p = '\0';
@@ -494,7 +496,7 @@
line[0] = c;
lp = line;
- while (lp - line < sizeof(line)) {
+ while (lp - line < (ptrdiff_t)sizeof(line)) {
if (c == '\\') {
*lp = ' ';
backsl();