aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-iconv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c
index fdd66fa956..35106577f0 100644
--- a/e-util/e-iconv.c
+++ b/e-util/e-iconv.c
@@ -317,12 +317,12 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
struct _iconv_cache_node *in;
iconv_t ip;
+ if (oto == NULL || ofrom == NULL)
+ return (iconv_t)-1;
+
to = e_iconv_charset_name(oto);
from = e_iconv_charset_name(ofrom);
- if (to == NULL)
- to = "";
- if (from == NULL)
- from = "";
+
tofrom = alloca(strlen(to) +strlen(from) + 2);
sprintf(tofrom, "%s%%%s", to, from);