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:
Markus Armbruster 2008-02-25 20:57:33 +01:00
parent 990b39edec
commit 5490782db3
7 changed files with 52 additions and 9 deletions

View file

@ -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);