Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Since limit and l are both unsigned, comparing...



details:   https://anonhg.NetBSD.org/src/rev/8fdc309474ff
branches:  trunk
changeset: 759381:8fdc309474ff
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Dec 07 22:02:52 2010 +0000

description:
Since limit and l are both unsigned, comparing to 0 doesn't work, so compare
the values directly.

diffstat:

 lib/libcurses/getch.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0badf0ec4c9f -r 8fdc309474ff lib/libcurses/getch.c
--- a/lib/libcurses/getch.c     Tue Dec 07 22:01:45 2010 +0000
+++ b/lib/libcurses/getch.c     Tue Dec 07 22:02:52 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index