(ef_ptr, ef_read): Undo rev. 1.52 for these two, because there are
callers that rely on these functions to fail for bad ID.
This commit is contained in:
parent
69582d0d15
commit
d575d779ad
1 changed files with 2 additions and 6 deletions
|
@ -212,10 +212,8 @@ ef_ptr(int type, int id)
|
|||
ep = &empfile[type];
|
||||
if (CANT_HAPPEN(!(ep->flags & EFF_MEM) || !ep->cache))
|
||||
return NULL;
|
||||
if (id < 0 || id >= ep->fids) {
|
||||
CANT_HAPPEN(id != ep->fids);
|
||||
if (id < 0 || id >= ep->fids)
|
||||
return NULL;
|
||||
}
|
||||
return ep->cache + ep->size * id;
|
||||
}
|
||||
|
||||
|
@ -235,10 +233,8 @@ ef_read(int type, int id, void *into)
|
|||
ep = &empfile[type];
|
||||
if (CANT_HAPPEN(!ep->cache))
|
||||
return 0;
|
||||
if (id < 0 || id >= ep->fids) {
|
||||
CANT_HAPPEN(id != ep->fids);
|
||||
if (id < 0 || id >= ep->fids)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ep->flags & EFF_MEM) {
|
||||
from = ep->cache + id * ep->size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue