From 3d9123eca4abdaa6582bb4d77b68e7d18650507c Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Wed, 18 Aug 1999 10:45:27 +0000 Subject: [PATCH] Another fix for the difflen problem. --- isamc/isamd.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/isamc/isamd.c b/isamc/isamd.c index f398b99..6013abd 100644 --- a/isamc/isamd.c +++ b/isamc/isamd.c @@ -455,12 +455,15 @@ ISAMD_PP isamd_pp_open (ISAMD is, ISAMD_P ipos) { ISAMD_PP pp = (ISAMD_PP) xmalloc (sizeof(*pp)); char *src; + int sz = is->method->filecat[is->max_cat].bsize; + /* always allocate for the largest blocks, saves trouble */ pp->cat = isamd_type(ipos); pp->pos = isamd_block(ipos); - src = pp->buf = (char *) xmalloc (is->method->filecat[is->max_cat].bsize); - /* always allocate for the largest blocks, saves trouble */ + src = pp->buf = (char *) xmalloc (sz); + memset(src,'\0',sz); /* clear the buffer, for new blocks */ + pp->next = 0; pp->size = 0; pp->offset = 0; @@ -690,7 +693,10 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) /* * $Log: isamd.c,v $ - * Revision 1.6 1999-08-17 19:44:25 heikki + * Revision 1.7 1999-08-18 10:45:27 heikki + * Another fix for the difflen problem. + * + * Revision 1.6 1999/08/17 19:44:25 heikki * Fixed memory leaks * * Revision 1.4 1999/08/04 14:21:18 heikki -- 1.7.10.4