From 6f846ddf3213c825b676f770b5c8c053066ec4c7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 14 Apr 2011 17:22:53 +1000 Subject: 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 Autobuild-Date: Wed Apr 20 05:17:48 CEST 2011 on sn-devel-104 --- lib/util/charset/convert_string.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/util') 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); } /** -- cgit