Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdlib If new length is exactly equals to the curre...



details:   https://anonhg.NetBSD.org/src/rev/2d209750ee6e
branches:  trunk
changeset: 757859:2d209750ee6e
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Sep 29 00:44:04 2010 +0000

description:
If new length is exactly equals to the current length,
there is nothing to do.

diffstat:

 lib/libc/stdlib/getenv.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 047ab598c0fa -r 2d209750ee6e lib/libc/stdlib/getenv.c
--- a/lib/libc/stdlib/getenv.c  Wed Sep 29 00:40:17 2010 +0000
+++ b/lib/libc/stdlib/getenv.c  Wed Sep 29 00:44:04 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getenv.c,v 1.22 2010/09/25 19:31:51 christos Exp $     */
+/*     $NetBSD: getenv.c,v 1.23 2010/09/29 00:44:04 enami Exp $        */
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getenv.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: getenv.c,v 1.22 2010/09/25 19:31:51 christos Exp $");
+__RCSID("$NetBSD: getenv.c,v 1.23 2010/09/29 00:44:04 enami Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -113,7 +113,7 @@
        }
 
        nl = offset + 2;        /* one for potentially new entry one for NULL */
-       if (nl < environ_malloced_len)
+       if (nl <= environ_malloced_len)
                return 0;
 
        p = realloc(__environ_malloced, nl * sizeof(*p));



Home | Main Index | Thread Index | Old Index