(xuheader): Check for unexpected table before oopsing on !EFF_MEM.
This commit is contained in:
parent
8a6438b4e0
commit
72127c838f
1 changed files with 4 additions and 5 deletions
|
@ -565,7 +565,6 @@ static int
|
||||||
xuheader(FILE *fp, int expected_table)
|
xuheader(FILE *fp, int expected_table)
|
||||||
{
|
{
|
||||||
char name[64];
|
char name[64];
|
||||||
struct empfile *ep;
|
|
||||||
int res, ch;
|
int res, ch;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
|
@ -589,13 +588,13 @@ xuheader(FILE *fp, int expected_table)
|
||||||
type = ef_byname(name);
|
type = ef_byname(name);
|
||||||
if (type < 0)
|
if (type < 0)
|
||||||
return gripe("Unknown table `%s'", name);
|
return gripe("Unknown table `%s'", name);
|
||||||
ep = &empfile[type];
|
|
||||||
if (CANT_HAPPEN(!(ep->flags & EFF_MEM)))
|
|
||||||
return -1; /* not implemented */
|
|
||||||
|
|
||||||
if (expected_table != EF_BAD && expected_table != type)
|
if (expected_table != EF_BAD && expected_table != type)
|
||||||
return gripe("Expected table `%s', not `%s'",
|
return gripe("Expected table `%s', not `%s'",
|
||||||
ef_nameof(expected_table), name);
|
ef_nameof(expected_table), name);
|
||||||
|
|
||||||
|
if (CANT_HAPPEN(!(ef_flags(type) & EFF_MEM)))
|
||||||
|
return -1;
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue