From 103cddc545885b35ad1240d5fbf1e3c2b2ae7811 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 14 Aug 2020 19:26:55 -0400 Subject: only return the part after the = --- src/stdlib/getenv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/stdlib') diff --git a/src/stdlib/getenv.c b/src/stdlib/getenv.c index 4ba83edb..8cb99463 100644 --- a/src/stdlib/getenv.c +++ b/src/stdlib/getenv.c @@ -12,11 +12,11 @@ char * getenv(const char * name) for (i = 0; environ[i] != NULL; i++) { if (!strncmp(environ[i], name, len) && environ[i][len] == '=') { - break; + return environ[i] + len + 1; } } - return environ[i]; + return NULL; } /*** -- cgit v1.2.1