forked from github/server
segmentation fault caused by new getstrtoken semantics
This commit is contained in:
parent
86c2096cfa
commit
1c069da921
|
@ -2766,7 +2766,7 @@ static void breed_cmd(unit * u, struct order *ord)
|
|||
(void)init_order(ord);
|
||||
s = getstrtoken();
|
||||
|
||||
m = atoi((const char *)s);
|
||||
m = s ? atoi((const char *)s) : 0;
|
||||
if (m != 0) {
|
||||
/* first came a want-paramter */
|
||||
s = getstrtoken();
|
||||
|
|
10
src/laws.c
10
src/laws.c
|
@ -3923,10 +3923,14 @@ void defaultorders(void)
|
|||
order *ord = *ordp;
|
||||
if (getkeyword(ord) == K_DEFAULT) {
|
||||
char lbuf[8192];
|
||||
order *new_order;
|
||||
order *new_order = 0;
|
||||
const char *s;
|
||||
init_order(ord);
|
||||
strcpy(lbuf, getstrtoken());
|
||||
new_order = parse_order(lbuf, u->faction->locale);
|
||||
s = getstrtoken();
|
||||
if (s) {
|
||||
strcpy(lbuf, s);
|
||||
new_order = parse_order(lbuf, u->faction->locale);
|
||||
}
|
||||
*ordp = ord->next;
|
||||
ord->next = NULL;
|
||||
free_order(ord);
|
||||
|
|
Loading…
Reference in New Issue