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

Side by Side Diff: fusl/src/passwd/getspnam.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 unified diff | Download patch
OLDNEW
1 #include "pwf.h" 1 #include "pwf.h"
2 2
3 #define LINE_LIM 256 3 #define LINE_LIM 256
4 4
5 struct spwd *getspnam(const char *name) 5 struct spwd* getspnam(const char* name) {
6 { 6 static struct spwd sp;
7 » static struct spwd sp; 7 static char* line;
8 » static char *line; 8 struct spwd* res;
9 » struct spwd *res; 9 int e;
10 » int e;
11 10
12 » if (!line) line = malloc(LINE_LIM); 11 if (!line)
13 » if (!line) return 0; 12 line = malloc(LINE_LIM);
14 » e = getspnam_r(name, &sp, line, LINE_LIM, &res); 13 if (!line)
15 » if (e) errno = e; 14 return 0;
16 » return res; 15 e = getspnam_r(name, &sp, line, LINE_LIM, &res);
16 if (e)
17 errno = e;
18 return res;
17 } 19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698