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

Side by Side Diff: fusl/src/string/strsep.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 #define _GNU_SOURCE 1 #define _GNU_SOURCE
2 #include <string.h> 2 #include <string.h>
3 3
4 char *strsep(char **str, const char *sep) 4 char* strsep(char** str, const char* sep) {
5 { 5 char *s = *str, *end;
6 » char *s = *str, *end; 6 if (!s)
7 » if (!s) return NULL; 7 return NULL;
8 » end = s + strcspn(s, sep); 8 end = s + strcspn(s, sep);
9 » if (*end) *end++ = 0; 9 if (*end)
10 » else end = 0; 10 *end++ = 0;
11 » *str = end; 11 else
12 » return s; 12 end = 0;
13 *str = end;
14 return s;
13 } 15 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698