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

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

Powered by Google App Engine
This is Rietveld 408576698