Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/catman make len unsigned; -1 will turn into a large...



details:   https://anonhg.NetBSD.org/src/rev/59ce113ed16b
branches:  trunk
changeset: 772221:59ce113ed16b
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 24 23:46:11 2011 +0000

description:
make len unsigned; -1 will turn into a large number, failing the test.

diffstat:

 usr.sbin/catman/catman.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r a219a9251abe -r 59ce113ed16b usr.sbin/catman/catman.c
--- a/usr.sbin/catman/catman.c  Sat Dec 24 23:42:30 2011 +0000
+++ b/usr.sbin/catman/catman.c  Sat Dec 24 23:46:11 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: catman.c,v 1.33 2011/12/24 23:42:30 christos Exp $       */
+/*      $NetBSD: catman.c,v 1.34 2011/12/24 23:46:11 christos Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -561,10 +561,10 @@
 {
        char crunchbuf[1024];
        char sysbuf[2048];
-       int len;
+       size_t len;
 
        len = snprintf(sysbuf, sizeof(sysbuf), buildcmd, manpage);
-       if (len < 0 || len > sizeof(sysbuf))
+       if (len > sizeof(sysbuf))
                errx(1, "snprintf");
 
        if (*crunchcmd != '\0') {



Home | Main Index | Thread Index | Old Index