-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
- *
- * $Id: yaziconv.c,v 1.3 2005-01-17 13:09:43 adam Exp $
*/
#if HAVE_CONFIG_H
{
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;
}
if (verbose > 1)
{
- fprintf (stderr, "yaz_iconv: inbytesleft=%d outbytesleft=%d\n",
- inbytesleft, outbytesleft);
+ fprintf (stderr, "yaz_iconv: inbytesleft=%ld outbytesleft=%ld\n",
+ (long) inbytesleft, (long) outbytesleft);
}
r = yaz_iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
}
if (r == 0)
{
- fprintf (stderr, "invalid sequence\n");
+ fprintf (stderr, "invalid sequence due to missing input\n");
return ;
}
inbytesleft += r;
break;
default:
fprintf (stderr, "yaziconv: Usage\n"
- "siconv -f encoding -t encoding [-v] [file]\n");
+ "yaziconv -f encoding -t encoding [-v] [file]\n");
exit(1);
}
}
yaz_iconv_close (cd);
return 0;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+