summaryrefslogtreecommitdiff
path: root/source4/torture/local
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-25 04:48:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:47 -0500
commit7ea949e7abeac27a36d0b5a2ad444a9414ccc94d (patch)
tree2a627a785da24d6ded1118181bc287753b023733 /source4/torture/local
parent1603fd94666d3175e9df12652f9ff4e1d14de064 (diff)
downloadsamba-7ea949e7abeac27a36d0b5a2ad444a9414ccc94d.tar.gz
samba-7ea949e7abeac27a36d0b5a2ad444a9414ccc94d.tar.bz2
samba-7ea949e7abeac27a36d0b5a2ad444a9414ccc94d.zip
r7898: don't die on bad iconv libs in LOCAL-ICONV test
(This used to be commit fe7055df94ecc81d6758ee7ff82534451d620d6a)
Diffstat (limited to 'source4/torture/local')
-rw-r--r--source4/torture/local/iconv.c8
1 files changed, 8 insertions, 0 deletions
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;