From fcfe59c1f2219408ac2a9cd84b386816ff252221 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 11 Jun 2022 16:37:09 +0200 Subject: Fix warnings, replace some static inline with inline + extern inline, and fix glibc support --- getenv_e.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'getenv_e.c') diff --git a/getenv_e.c b/getenv_e.c index c09859d..95eb34e 100644 --- a/getenv_e.c +++ b/getenv_e.c @@ -12,13 +12,16 @@ extern inline const char *libsimple_getenv_e(const char *); int main(void) { + char env1[] = "X=xyz"; + char env2[] = "X="; + unsetenv("X"); assert(!getenv("X")); assert(!strcmpnul(libsimple_getenv_e("X"), "")); - putenv("X=xyz"); + putenv(env1); assert(!strcmpnul(getenv("X"), "xyz")); assert(!strcmpnul(libsimple_getenv_e("X"), "xyz")); - putenv("X="); + putenv(env2); assert(!strcmpnul(getenv("X"), "")); assert(!strcmpnul(libsimple_getenv_e("X"), "")); -- cgit v1.2.3-70-g09d2