(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:
Markus Armbruster 2005-11-19 11:20:13 +00:00
parent 69582d0d15
commit d575d779ad

View file

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