diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-14 17:22:53 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-20 05:17:48 +0200 |
commit | 6f846ddf3213c825b676f770b5c8c053066ec4c7 (patch) | |
tree | 08ae889e279560121793b847fb36650377cedb7c /lib/util | |
parent | 79e6fea77443099a6ebe4a2e3bbf606cd444341d (diff) | |
download | samba-6f846ddf3213c825b676f770b5c8c053066ec4c7.tar.gz samba-6f846ddf3213c825b676f770b5c8c053066ec4c7.tar.bz2 samba-6f846ddf3213c825b676f770b5c8c053066ec4c7.zip |
lib/util/charset Always set *converted_size even on failure
The caller may wish to inspect the partially converted string.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 20 05:17:48 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/charset/convert_string.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/util/charset/convert_string.c b/lib/util/charset/convert_string.c index 14dad61aeb..e51add2aaf 100644 --- a/lib/util/charset/convert_string.c +++ b/lib/util/charset/convert_string.c @@ -85,11 +85,9 @@ static bool convert_string_internal(struct smb_iconv_handle *ic, o_len=destlen; retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len); - if (retval == (size_t)-1) { - return false; - } *converted_size = destlen-o_len; - return true; + + return (retval != (size_t)-1); } /** |