summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-03-25 10:52:32 +1100
committerAndrew Tridgell <tridge@samba.org>2011-03-25 04:37:06 +0100
commit7824111d07ae12b34e03da1e72884d421a9f9f33 (patch)
tree02b5bdd2d84d3a0dd94375fbef7a28d1c2589a6f
parentd85dbfb3dbb7a17c38f1f981362cc68400fa4410 (diff)
downloadsamba-7824111d07ae12b34e03da1e72884d421a9f9f33.tar.gz
samba-7824111d07ae12b34e03da1e72884d421a9f9f33.tar.bz2
samba-7824111d07ae12b34e03da1e72884d421a9f9f33.zip
s3-charcnv: convert_string_internal() should not display errors
debug error display happens in the convert_string() outer function
-rw-r--r--source3/lib/charcnv.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 343c077709..0c34317a3b 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -118,7 +118,7 @@ static size_t convert_string_internal(charset_t from, charset_t to,
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
- DEBUG(0,("convert_string_internal: Conversion not supported.\n"));
+ errno = EINVAL;
return (size_t)-1;
}
@@ -126,36 +126,9 @@ static size_t convert_string_internal(charset_t from, charset_t to,
o_len=destlen;
retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len);
- if(retval==(size_t)-1) {
- const char *reason="unknown error";
- switch(errno) {
- case EINVAL:
- reason="Incomplete multibyte sequence";
- DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
- return (size_t)-1;
- case E2BIG:
- reason="No more room";
- if (from == CH_UNIX) {
- DEBUG(3,("E2BIG: convert_string(%s,%s): srclen=%u destlen=%u - '%s'\n",
- charset_name(ic, from), charset_name(ic, to),
- (unsigned int)srclen, (unsigned int)destlen, (const char *)src));
- } else {
- DEBUG(3,("E2BIG: convert_string(%s,%s): srclen=%u destlen=%u\n",
- charset_name(ic, from), charset_name(ic, to),
- (unsigned int)srclen, (unsigned int)destlen));
- }
- break;
- case EILSEQ:
- reason="Illegal multibyte sequence";
- DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
- return (size_t)-1;
- default:
- DEBUG(0,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
- return (size_t)-1;
- }
- /* smb_panic(reason); */
- }
- return destlen-o_len;
+ if (converted_size != NULL)
+ *converted_size = destlen-o_len;
+ return retval;
}
/**