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

Side by Side Diff: fusl/src/unistd/getlogin_r.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 <unistd.h> 1 #include <unistd.h>
2 #include <string.h> 2 #include <string.h>
3 #include <errno.h> 3 #include <errno.h>
4 4
5 int getlogin_r(char *name, size_t size) 5 int getlogin_r(char* name, size_t size) {
6 { 6 char* logname = getlogin();
7 » char *logname = getlogin(); 7 if (!logname)
8 » if (!logname) return ENXIO; /* or...? */ 8 return ENXIO; /* or...? */
9 » if (strlen(logname) >= size) return ERANGE; 9 if (strlen(logname) >= size)
10 » strcpy(name, logname); 10 return ERANGE;
11 » return 0; 11 strcpy(name, logname);
12 return 0;
12 } 13 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698