diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-04-03 08:28:22 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-03 08:28:22 +1100 |
commit | 2f04b7d29a9e93152ff40a04afa50d3755ff0a25 (patch) | |
tree | ccef6bba0937d61bd461335e510db9813b5c24ce /source3/lib | |
parent | 354ba5e2e35c0adb2dd04f81a6ce7d1d721f31dc (diff) | |
parent | 31ab1d6a6487fb442ccd5b2cd093b4a2b7b80291 (diff) | |
download | samba-2f04b7d29a9e93152ff40a04afa50d3755ff0a25.tar.gz samba-2f04b7d29a9e93152ff40a04afa50d3755ff0a25.tar.bz2 samba-2f04b7d29a9e93152ff40a04afa50d3755ff0a25.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wspp-schema
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/charcnv.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index c3b345142f..03b32c13d4 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -242,7 +242,7 @@ static size_t convert_string_internal(charset_t from, charset_t to, DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf)); if (allow_bad_conv) goto use_as_is; - break; + return (size_t)-1; case E2BIG: reason="No more room"; if (!conv_silent) { @@ -263,11 +263,12 @@ static size_t convert_string_internal(charset_t from, charset_t to, DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf)); if (allow_bad_conv) goto use_as_is; - break; + + return (size_t)-1; default: if (!conv_silent) DEBUG(0,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf)); - break; + return (size_t)-1; } /* smb_panic(reason); */ } @@ -412,7 +413,11 @@ size_t convert_string(charset_t from, charset_t to, #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS goto general_case; #else - return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + if (ret == (size_t)-1) { + return ret; + } + return retval + ret; #endif } } @@ -448,7 +453,11 @@ size_t convert_string(charset_t from, charset_t to, #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS goto general_case; #else - return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + if (ret == (size_t)-1) { + return ret; + } + return retval + ret; #endif } } @@ -484,7 +493,11 @@ size_t convert_string(charset_t from, charset_t to, #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS goto general_case; #else - return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv); + if (ret == (size_t)-1) { + return ret; + } + return retval + ret; #endif } } |