From: Heikki Levanto Date: Wed, 18 Aug 1999 10:45:27 +0000 (+0000) Subject: Another fix for the difflen problem. X-Git-Tag: ZEBRA.1.0~51 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=3d9123eca4abdaa6582bb4d77b68e7d18650507c;p=idzebra-moved-to-github.git Another fix for the difflen problem. --- 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