diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
commit | c1fe19d4c1db610692365472a90f4661e48449c1 (patch) | |
tree | d0b0219ffca3c4c4256f55c4aea4513e43d6aecd /libc/stdlib/getenv.c | |
parent | 9efafb8bbc7408b04643dcd53825d971577b4d9d (diff) |
Bug ugly formatting update
Diffstat (limited to 'libc/stdlib/getenv.c')
-rw-r--r-- | libc/stdlib/getenv.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c index 1ed83a622..b5d4de9aa 100644 --- a/libc/stdlib/getenv.c +++ b/libc/stdlib/getenv.c @@ -6,26 +6,22 @@ #include <stdlib.h> #include <malloc.h> -extern char ** environ; +extern char **environ; -char * -getenv(var) -const char * var; +char *getenv(var) +const char *var; { - char **p; - int len; + char **p; + int len; - len = strlen(var); - - if (!environ) - return 0; - - for(p=environ; *p; p++) - { - if( memcmp(var, *p, len) == 0 && (*p)[len] == '=' ) - return *p + len + 1; - } - return 0; -} + len = strlen(var); + if (!environ) + return 0; + for (p = environ; *p; p++) { + if (memcmp(var, *p, len) == 0 && (*p)[len] == '=') + return *p + len + 1; + } + return 0; +} |