Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!decvax!tektronix!orca!tekecs!leia!jeffb From: jeffb@leia.UUCP Newsgroups: net.news.b Subject: rn Patch #14 causes realloc mixups on "rn -c" (ala patch #22) Message-ID: <156@leia.GWD.TEK.COM> Date: Fri, 3-Oct-86 17:59:04 EDT Article-I.D.: leia.156 Posted: Fri Oct 3 17:59:04 1986 Date-Received: Mon, 6-Oct-86 18:24:21 EDT Reply-To: jeffb@leia.GWD.TEK.COM (Jeff Beachy) Distribution: net Organization: Tektronix, Inc., Wilsonville, OR Lines: 35 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 jeffb@tekecs.GWD.TEK.COM -or- {ihnp4, decvax, ucbvax}!tektronix!tekecs!jeffb