Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: fusl/src/env/getenv.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fusl/src/env/getenv.c
diff --git a/fusl/src/env/getenv.c b/fusl/src/env/getenv.c
index 00c1bce03725bf51c077cf6334d826105f5ad12e..c1c496755ba12e68e0052d1c3292702feb0c88b5 100644
--- a/fusl/src/env/getenv.c
+++ b/fusl/src/env/getenv.c
@@ -2,13 +2,16 @@
#include <string.h>
#include "libc.h"
-char *getenv(const char *name)
-{
- int i;
- size_t l = strlen(name);
- if (!__environ || !*name || strchr(name, '=')) return NULL;
- for (i=0; __environ[i] && (strncmp(name, __environ[i], l)
- || __environ[i][l] != '='); i++);
- if (__environ[i]) return __environ[i] + l+1;
- return NULL;
+char* getenv(const char* name) {
+ int i;
+ size_t l = strlen(name);
+ if (!__environ || !*name || strchr(name, '='))
+ return NULL;
+ for (i = 0; __environ[i] &&
+ (strncmp(name, __environ[i], l) || __environ[i][l] != '=');
+ i++)
+ ;
+ if (__environ[i])
+ return __environ[i] + l + 1;
+ return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698