diff options
| author | enami <enami@NetBSD.org> | 2010-09-29 00:44:04 +0000 |
|---|---|---|
| committer | enami <enami@NetBSD.org> | 2010-09-29 00:44:04 +0000 |
| commit | be59ef257e99381fdfbf4b881b6ac9df2541a292 (patch) | |
| tree | e3203317f1363873960924902a3b91cf15f2539d /lib/libc/stdlib | |
| parent | 248290ef3a12f4b60675d635328f63b6c9ef0de5 (diff) | |
If new length is exactly equals to the current length,
there is nothing to do.
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/getenv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index 38ac7280d1e..f47e9179787 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -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 @@ __allocenv(int offset) } 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)); |
