From: Heikki Levanto Date: Tue, 24 Aug 2004 08:52:30 +0000 (+0000) Subject: Fixed a crash with isam-c and multior (incremented a non-existing countp) X-Git-Tag: snippet.version.1~401 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=9c50a60b4bd5de297f77866fd173c78a10328498 Fixed a crash with isam-c and multior (incremented a non-existing countp) --- diff --git a/rset/rsisamc.c b/rset/rsisamc.c index 681868b..a70d7ae 100644 --- a/rset/rsisamc.c +++ b/rset/rsisamc.c @@ -1,4 +1,4 @@ -/* $Id: rsisamc.c,v 1.19 2004-08-23 12:38:53 heikki Exp $ +/* $Id: rsisamc.c,v 1.20 2004-08-24 08:52:30 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -57,7 +57,6 @@ struct rset_pp_info { ISAMC_PP pt; struct rset_pp_info *next; struct rset_isamc_info *info; - zint *countp; void *buf; }; @@ -141,14 +140,6 @@ static int r_read (RSFD rfd, void *buf) struct rset_pp_info *pinfo = (struct rset_pp_info *) rfd; int r; r = isc_pp_read(pinfo->pt, buf); - if (r > 0) - { - if (*pinfo->countp == 0 || (*pinfo->info->cmp)(buf, pinfo->buf) > 1) - { - memcpy (pinfo->buf, buf, pinfo->info->key_size); - (*pinfo->countp)++; - } - } return r; } diff --git a/rset/rstemp.c b/rset/rstemp.c index 0a3b582..325faf2 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,4 +1,4 @@ -/* $Id: rstemp.c,v 1.43 2004-08-20 14:44:46 heikki Exp $ +/* $Id: rstemp.c,v 1.44 2004-08-24 08:52:30 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -79,7 +79,6 @@ struct rset_temp_info { struct rset_temp_rfd { struct rset_temp_info *info; struct rset_temp_rfd *next; - zint *countp; void *buf; size_t pos_cur; /* current position in set */ zint cur; /* number of the current hit */ @@ -137,7 +136,6 @@ static RSFD r_open (RSET ct, int flag) rfd->info = info; r_rewind (rfd); - *rfd->countp = 0; rfd->buf = xmalloc (info->key_size); return rfd; @@ -330,12 +328,6 @@ static int r_read (RSFD rfd, void *buf) memcpy (buf, info->buf_mem + (mrfd->pos_cur - info->pos_buf), info->key_size); mrfd->pos_cur = nc; - - if (*mrfd->countp == 0 || (*info->cmp)(buf, mrfd->buf) > 1) - { - memcpy (mrfd->buf, buf, mrfd->info->key_size); - (*mrfd->countp)++; - } mrfd->cur++; return 1; }