From 1534d99bbd8c7d32fde4b00a8cf3db3aa1ea440e Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 12 Oct 2001 21:32:42 +0000 Subject: Changed the crash fix to just return -1. 2001-10-12 Christopher James Lahey * gal/util/e-iconv.c (e_iconv_open): Changed the crash fix to just return -1. svn path=/trunk/; revision=13629 --- e-util/e-iconv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'e-util/e-iconv.c') 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); -- cgit v1.2.3