Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rn Patch #14 causes realloc mixups on "rn -c" (ala patch #22)

0 views
Skip to first unread message

je...@leia.uucp

unread,
Oct 3, 1986, 5:59:04 PM10/3/86
to
Note: My mail to Larry may have gone to the bit bucket, so here is
attempt number two.

Description:
Patch #14 attempted to speed up "rn -c" by using a static buffer
instead of an malloc'ed one. Unfortunately, buried deep down in
a routine called checkexpired there was an unguarded call to
saferealloc(), which calls realloc(). This confused realloc()
to no end, since it didn't know how large the area being realloc'ed
was originally; or rather, it thought it knew, but it really didn't.


*** rcln.c.new Fri Sep 12 21:53:10 1986
--- rcln.c.old Fri Sep 12 21:52:49 1986
***************
*** 427,433
*t++ = ',';
strcpy(t,s);
}
! if (!checkflag && mbuf == rcline[ngnum]) {
rcline[ngnum] = saferealloc(rcline[ngnum],
(MEM_SIZE)(rcnums[ngnum] + strlen(newnum) + 1));
}

--- 427,433 -----
*t++ = ',';
strcpy(t,s);
}
! if (mbuf == rcline[ngnum]) {
rcline[ngnum] = saferealloc(rcline[ngnum],
(MEM_SIZE)(rcnums[ngnum] + strlen(newnum) + 1));
}
--
Jeff Beachy AIM, Tektronix, Inc., Wilsonville, OR
je...@tekecs.GWD.TEK.COM -or- {ihnp4, decvax, ucbvax}!tektronix!tekecs!jeffb

0 new messages