/*
- * $Id: ad_open.c,v 1.27 2003-02-16 12:35:05 didg Exp $
+ * $Id: ad_open.c,v 1.28 2003-02-17 06:26:53 didg Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
static void parse_entries(struct adouble *ad, char *buf,
u_int16_t nentries)
{
- u_int32_t eid, len, off;
+ u_int32_t eid, len, off;
+ int warning = 0;
/* now, read in the entry bits */
for (; nentries > 0; nentries-- ) {
if ( 0 < eid && eid < ADEID_MAX ) {
ad->ad_eid[ eid ].ade_off = off;
ad->ad_eid[ eid ].ade_len = len;
- } else {
+ } else if (!warning) {
+ warning = 1;
LOG(log_debug, logtype_default, "ad_refresh: nentries %hd eid %d\n",
nentries, eid );
}
/* figure out all of the entry offsets and lengths. if we aren't
* able to read a resource fork entry, bail. */
+ nentries = len / AD_ENTRY_LEN;
parse_entries(ad, buf, nentries);
if (!ad_getentryoff(ad, ADEID_RFORK)
|| (ad_getentryoff(ad, ADEID_RFORK) > sizeof(ad->ad_data))