From: Adam Dickmeiss Date: Tue, 10 Dec 2002 10:23:21 +0000 (+0000) Subject: Fixed buffer handling (incomplete input) in yaziconv test X-Git-Tag: YAZ.1.9.2.oleg~6 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=4d5043a735f072b648a7550b8f460726721b9f14 Fixed buffer handling (incomplete input) in yaziconv test --- diff --git a/util/siconvtst.c b/util/siconvtst.c index cbe4ec2..baded66 100644 --- a/util/siconvtst.c +++ b/util/siconvtst.c @@ -2,7 +2,7 @@ * Copyright (c) 1997-2002, Index Data * See the file LICENSE for details. * - * $Id: siconvtst.c,v 1.4 2002-08-28 19:33:53 adam Exp $ + * $Id: siconvtst.c,v 1.5 2002-12-10 10:23:21 adam Exp $ */ #if HAVE_CONFIG_H @@ -15,14 +15,15 @@ #include -#define CHUNK 8 +#define CHUNK_IN 64 +#define CHUNK_OUT 64 void convert (FILE *inf, yaz_iconv_t cd) { - char inbuf0[CHUNK], *inbuf = inbuf0; - char outbuf0[CHUNK], *outbuf = outbuf0; - size_t outbytesleft = CHUNK; - size_t inbytesleft = CHUNK; + char inbuf0[CHUNK_IN], *inbuf = inbuf0; + char outbuf0[CHUNK_OUT], *outbuf = outbuf0; + size_t inbytesleft = CHUNK_IN; + size_t outbytesleft = CHUNK_OUT; int mustread = 1; while (1) @@ -61,15 +62,30 @@ void convert (FILE *inf, yaz_iconv_t cd) size_t i; for (i = 0; i