Make generation numbers catch more potential yields on input

getstarg(), snxtitem() and snxtsct() can yield the processor, because
they call getstring().  But only for null or empty arguments.  For
other arguments, we should call ef_make_stale(), to catch errors.
Problem: if a caller never passes null or empty arguments, it may rely
on these functions not yielding.  We'd get false positives.  In
general, we can't know whether that's the case.  But we do know in the
common special case of player arguments.  Call ef_make_stale() for
those.
This commit is contained in:
Markus Armbruster 2011-04-11 21:37:23 +02:00
parent 47b68a1c1f
commit e3cf1e3280
6 changed files with 40 additions and 5 deletions

View file

@ -363,6 +363,7 @@ extern int natpass(natid, char *);
extern struct player *player; /* current player's context */
extern char *praddr(struct player *);
extern void player_main(struct player *);
extern void make_stale_if_command_arg(char *);
/* more under Commands */
/* recvclient.c */
extern int recvclient(char *, int);