PERFORCE change 113269 for review
Todd Miller
millert at FreeBSD.org
Sun Jan 21 22:50:51 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113269
Change 113269 by millert at 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,
More information about the trustedbsd-cvs
mailing list