Check ef_type before dereferencing struct empobj
Such manual checking is error prone, but the best we can do right now.
This commit is contained in:
parent
990b39edec
commit
5490782db3
7 changed files with 52 additions and 9 deletions
|
@ -61,6 +61,9 @@ radar(short type)
|
|||
char buf[1024];
|
||||
char prompt[80];
|
||||
|
||||
if (CANT_HAPPEN(type != EF_LAND && type != EF_SHIP))
|
||||
type = EF_SHIP;
|
||||
|
||||
sprintf(prompt, "Radar from (%s # or sector(s)) : ", ef_nameof(type));
|
||||
cp = getstarg(player->argp[1], prompt, buf);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue