X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaziconv.c;h=f91c60bc27781d6467cd21a12436a58ae237d1b1;hb=9c75e92604fae1efd7137d085dd2281e7886345b;hp=35e38e3ea28dbe863f6a681aebbfc91323bac431;hpb=8d691989077a0addcbd840d769dce6700f3d9622;p=yaz-moved-to-github.git diff --git a/util/yaziconv.c b/util/yaziconv.c index 35e38e3..f91c60b 100644 --- a/util/yaziconv.c +++ b/util/yaziconv.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: yaziconv.c,v 1.6 2007-01-03 08:42:16 adam Exp $ + * $Id: yaziconv.c,v 1.8 2007-03-21 08:37:57 adam Exp $ */ #if HAVE_CONFIG_H @@ -44,6 +44,11 @@ void convert (FILE *inf, yaz_iconv_t cd, int verbose) { if (outbuf != outbuf0) fwrite (outbuf0, 1, outbuf - outbuf0, stdout); + outbuf = outbuf0; + outbytesleft = CHUNK_OUT; + r = yaz_iconv (cd, 0, 0, &outbuf, &outbytesleft); + if (outbuf != outbuf0) + fwrite (outbuf0, 1, outbuf - outbuf0, stdout); break; } inbytesleft = r; @@ -81,7 +86,7 @@ void convert (FILE *inf, yaz_iconv_t cd, int verbose) } if (r == 0) { - fprintf (stderr, "invalid sequence\n"); + fprintf (stderr, "invalid sequence due to missing input\n"); return ; } inbytesleft += r;