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

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

Powered by Google App Engine
This is Rietveld 408576698