-/* $Id: d1_read.c,v 1.23 2007-03-19 21:50:39 adam Exp $
+/* $Id: d1_read.c,v 1.25 2007-04-16 08:44:31 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
{
data1_absyn *absyn = data1_get_absyn(dh, name, 1);
data1_node *res;
+
if (!absyn)
{
yaz_log(YLOG_WARN, "Unable to acquire abstract syntax " "for '%s'",
{
char *outbuf = wrbuf->buf + wrbuf->pos;
size_t outlen = wrbuf->size - wrbuf->pos;
- if (yaz_iconv (t, &inbuf, &inlen, &outbuf, &outlen) ==
+ if (yaz_iconv(t, &inbuf, &inlen, &outbuf, &outlen) ==
(size_t)(-1) && yaz_iconv_error(t) != YAZ_ICONV_E2BIG)
{
/* bad data. stop and skip conversion entirely */
return -1;
}
else if (inlen == 0)
- { /* finished converting */
+ { /* finished converting, flush it */
+ yaz_iconv(t, 0, 0, &outbuf, &outlen);
wrbuf->pos = wrbuf->size - outlen;
break;
}