combo sequence is met. Before the error was not set so it would
be unknown.
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: siconv.c,v 1.33 2007-01-18 14:45:05 adam Exp $
+ * $Id: siconv.c,v 1.34 2007-03-09 08:39:38 adam Exp $
for (cd->comb_size = 0; cd->comb_size < 8; cd->comb_size++)
{
int comb = 0;
for (cd->comb_size = 0; cd->comb_size < 8; cd->comb_size++)
{
int comb = 0;
+ if (inbytesleft == 0 && cd->comb_size)
+ {
+ cd->my_errno = YAZ_ICONV_EINVAL;
+ x = 0;
+ *no_read = 0;
+ break;
+ }
x = yaz_read_marc8_comb(cd, inp, inbytesleft, no_read, &comb);
if (!comb || !x)
break;
x = yaz_read_marc8_comb(cd, inp, inbytesleft, no_read, &comb);
if (!comb || !x)
break;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tsticonv.c,v 1.24 2007-01-03 08:42:16 adam Exp $
+ * $Id: tsticonv.c,v 1.25 2007-03-09 08:39:38 adam Exp $
char outbuf[12];
size_t inbytesleft = strlen(buf);
const char *inp = buf;
char outbuf[12];
size_t inbytesleft = strlen(buf);
const char *inp = buf;
+ int rounds = 0;
+ for (rounds = 0; inbytesleft && rounds < sizeof(outbuf); rounds++)
{
size_t outbytesleft = sizeof(outbuf);
char *outp = outbuf;
size_t r = yaz_iconv(cd, (char**) &inp, &inbytesleft,
&outp, &outbytesleft);
{
size_t outbytesleft = sizeof(outbuf);
char *outp = outbuf;
size_t r = yaz_iconv(cd, (char**) &inp, &inbytesleft,
&outp, &outbytesleft);
+ wrbuf_write(b, outbuf, outp - outbuf);
if (r == (size_t) (-1))
{
int e = yaz_iconv_error(cd);
if (e != YAZ_ICONV_E2BIG)
break;
}
if (r == (size_t) (-1))
{
int e = yaz_iconv_error(cd);
if (e != YAZ_ICONV_E2BIG)
break;
}
- wrbuf_write(b, outbuf, outp - outbuf);
}
if (wrbuf_len(b) == strlen(cmpbuf)
&& !memcmp(cmpbuf, wrbuf_buf(b), wrbuf_len(b)))
}
if (wrbuf_len(b) == strlen(cmpbuf)
&& !memcmp(cmpbuf, wrbuf_buf(b), wrbuf_len(b)))
/* COMBINING ACUTE ACCENT */
YAZ_CHECK(tst_convert(cd, "Cours de mathâe",
"Cours de mathe\xcc\x81"));
/* COMBINING ACUTE ACCENT */
YAZ_CHECK(tst_convert(cd, "Cours de mathâe",
"Cours de mathe\xcc\x81"));
+
+
+ YAZ_CHECK(tst_convert(cd, "a\xea\x1e", "a\x1e\xcc\x8a"));
+
+ YAZ_CHECK(tst_convert(cd, "a\xea", "a"));
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* 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.7 2007-03-09 08:39:38 adam Exp $
- fprintf (stderr, "invalid sequence\n");
+ fprintf (stderr, "invalid sequence due to missing input\n");
return ;
}
inbytesleft += r;
return ;
}
inbytesleft += r;