[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

f



Thanks to Adam Heath's excellent work on parse.c, this isn't as important as
it might be :)  I think there is a small (non-lethal) bug in varbuf.c.
varbufextend() seems to allocate almost double what it should do.

Thinking about it, why the 80 characters over?  If people know of cases
where this is used lots I'll be happy to do some profiling.  However I'd
think that for functions like varbufaddbuf the 80 characters is unnessary
(but it would be a good idea for varbufaddc perhaps).


--- ../dpkg.orig/lib/varbuf.c	Fri Dec 29 20:25:24 2000
+++ lib/varbuf.c	Thu Dec 28 12:11:37 2000
@@ -87,7 +87,7 @@
   int newsize;
   char *newbuf;
 
-  newsize= v->size + 80 + v->used;
+  newsize= 80 + v->used;
   newbuf= realloc(v->buf,newsize);
   if (!newbuf) ohshite(_("failed to realloc for variable buffer"));
   v->size= newsize;

Adrian

Email: adrian.bridgett@iname.com
Windows NT - Unix in beta-testing. GPG/PGP keys available on public key servers
Debian GNU/Linux  -*-  By professionals for professionals  -*-  www.debian.org



Reply to: