Module Name: src
Committed By: joerg
Date: Tue Dec 7 22:02:52 UTC 2010
Modified Files:
src/lib/libcurses: getch.c
Log Message:
Since limit and l are both unsigned, comparing to 0 doesn't work, so compare
the values directly.
To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/lib/libcurses/getch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.56 src/lib/libcurses/getch.c:1.57
--- src/lib/libcurses/getch.c:1.56 Fri Nov 5 11:38:54 2010
+++ src/lib/libcurses/getch.c Tue Dec 7 22:02:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: getch.c,v 1.56 2010/11/05 11:38:54 blymn Exp $ */
+/* $NetBSD: getch.c,v 1.57 2010/12/07 22:02:52 joerg Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getch.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: getch.c,v 1.56 2010/11/05 11:38:54 blymn Exp $");
+__RCSID("$NetBSD: getch.c,v 1.57 2010/12/07 22:02:52 joerg Exp $");
#endif
#endif /* not lint */
@@ -467,7 +467,7 @@
if (s == NULL)
continue;
l = strlen(s) + 1;
- if (limit - l < 0)
+ if (limit < l)
continue;
strlcpy(p, s, limit);
p += l;