diff options
author | bubulle <bubulle@alioth.debian.org> | 2009-04-02 15:54:13 +0000 |
---|---|---|
committer | bubulle <bubulle@alioth.debian.org> | 2009-04-02 15:54:13 +0000 |
commit | bf9afdb5c20707c5af271cbdfd98f0bb60180eb1 (patch) | |
tree | f72e29d251d990358e3a080aa35c801104fa54ba /source/lib/charcnv.c | |
parent | fe09995a9ad2d43523063725462194c7b39a3ce9 (diff) | |
download | samba-bf9afdb5c20707c5af271cbdfd98f0bb60180eb1.tar.gz |
merge upstream 3.3.3
git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk/samba@2683 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'source/lib/charcnv.c')
-rw-r--r-- | source/lib/charcnv.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index c3b345142f..03b32c13d4 100644 --- a/source/lib/charcnv.c +++ b/source/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 } } |