Date: Sun, 21 Jan 2007 22:24:11 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113269 for review Message-ID: <200701212224.l0LMOBio060239@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113269 Change 113269 by millert@millert_macbook on 2007/01/21 22:23:46 Use strtok_r() not strtok() Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libselinux/src/matchpathcon.c#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libselinux/src/matchpathcon.c#4 (text+ko) ==== @@ -443,7 +443,7 @@ int pass, unsigned lineno) { int items, len, regerr, ret; - char *buf_p; + char *buf_p, *ptr; char *regex, *type, *context; const char *reg_buf; char *anchored_regex; @@ -459,9 +459,9 @@ if (*buf_p == '#' || *buf_p == 0) return 0; - regex = strtok(buf_p, " \t"); - type = strtok(NULL, " \t"); - context = strtok(NULL, " \t"); + regex = strtok_r(buf_p, " \t", &ptr); + type = strtok_r(NULL, " \t", &ptr); + context = strtok_r(NULL, " \t", &ptr); items = !!regex + !!type + !!context; if (items < 2) { myprintf("%s: line %d is missing fields, skipping\n", path,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701212224.l0LMOBio060239>