forked from github/server
fix bad strtok call
This commit is contained in:
parent
6e8e163099
commit
5b1e786fb2
|
@ -761,10 +761,10 @@ static int race_mask = 1;
|
|||
|
||||
static void mask_races(xmlNodePtr node, const char *key, int *maskp) {
|
||||
xmlChar *propValue = xmlGetProp(node, BAD_CAST key);
|
||||
char *tok;
|
||||
int mask = 0;
|
||||
assert(maskp);
|
||||
tok = strtok((char *)propValue, " ,");
|
||||
if (propValue) {
|
||||
char * tok = strtok((char *)propValue, " ,");
|
||||
while (tok) {
|
||||
race * rc = rc_get_or_create(tok);
|
||||
if (!rc->mask_item) {
|
||||
|
@ -774,8 +774,9 @@ static void mask_races(xmlNodePtr node, const char *key, int *maskp) {
|
|||
mask |= rc->mask_item;
|
||||
tok = strtok(NULL, " ,");
|
||||
}
|
||||
*maskp = mask;
|
||||
xmlFree(propValue);
|
||||
}
|
||||
*maskp = mask;
|
||||
}
|
||||
|
||||
static item_type *xml_readitem(xmlXPathContextPtr xpath, resource_type * rtype)
|
||||
|
|
Loading…
Reference in New Issue