From 7ea949e7abeac27a36d0b5a2ad444a9414ccc94d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 25 Jun 2005 04:48:20 +0000 Subject: r7898: don't die on bad iconv libs in LOCAL-ICONV test (This used to be commit fe7055df94ecc81d6758ee7ff82534451d620d6a) --- source4/torture/local/iconv.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/local/iconv.c b/source4/torture/local/iconv.c index e9dc3e16f8..e61d3348eb 100644 --- a/source4/torture/local/iconv.c +++ b/source4/torture/local/iconv.c @@ -38,6 +38,10 @@ static int gen_codepoint_utf16(unsigned int codepoint, size_t size_in, size_out, ret; if (!cd) { cd = iconv_open("UTF-16LE", "UCS-4LE"); + if (cd == (iconv_t)-1) { + cd = NULL; + return -1; + } } in[0] = codepoint & 0xFF; @@ -123,6 +127,10 @@ static int test_buffer(uint8_t *inbuf, size_t size, const char *charset) if (!cd) { cd = iconv_open(charset, "UTF-16LE"); + if (cd == (iconv_t)-1) { + cd = NULL; + return 0; + } cd2 = smb_iconv_open(charset, "UTF-16LE"); cd3 = smb_iconv_open("UTF-16LE", charset); last_charset = charset; -- cgit