From 45abfa28a45ed76ba446151928bf9959b914e15e Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Mon, 20 Apr 2009 14:09:32 +0300 Subject: [PATCH] src/strutil.c: Fix returning empty string with partially wrong recoding --- src/strutil.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/strutil.c b/src/strutil.c index c3d598497..4b9501b9e 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -106,14 +106,16 @@ _str_convert (GIConv coder, char *string, int size, GString * buffer) gsize bytes_read, bytes_written; GError *error = NULL; errno = 0; + if (string == NULL || buffer == NULL) return ESTR_FAILURE; +/* if (! used_class.is_valid_string (string)) { - return ESTR_FAILURE; + return ESTR_FAILURE; } - +*/ state = 0; if (size < 0) { @@ -208,7 +210,8 @@ _str_convert (GIConv coder, char *string, int size, GString * buffer) { if (tmp_buff != NULL) { - if (*tmp_buff){ + if (*tmp_buff) + { g_string_append (buffer, tmp_buff); g_free (tmp_buff); string += bytes_read;