Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/strtofflags.c
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | |||||
* Take string of arguments and return file flags. Return 0 on | * Take string of arguments and return file flags. Return 0 on | ||||
* success, 1 on failure. On failure, stringp is set to point | * success, 1 on failure. On failure, stringp is set to point | ||||
* to the offending token. | * to the offending token. | ||||
*/ | */ | ||||
int | int | ||||
strtofflags(char **stringp, u_long *setp, u_long *clrp) | strtofflags(char **stringp, u_long *setp, u_long *clrp) | ||||
{ | { | ||||
char *string, *p; | char *string, *p; | ||||
int i; | size_t i; | ||||
if (setp) | if (setp) | ||||
*setp = 0; | *setp = 0; | ||||
if (clrp) | if (clrp) | ||||
*clrp = 0; | *clrp = 0; | ||||
string = *stringp; | string = *stringp; | ||||
while ((p = strsep(&string, "\t ,")) != NULL) { | while ((p = strsep(&string, "\t ,")) != NULL) { | ||||
*stringp = p; | *stringp = p; | ||||
Show All 28 Lines |