From 063f8d21af2564bf6c627d791a33e892c413eb7e Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Sun, 14 Oct 2001 01:08:07 +0000 Subject: work around broken behavior in some iconv implementions that require the 2001-10-13 Larry Ewing * gal/util/e-iconv.c (e_iconv_open): work around broken behavior in some iconv implementions that require the length arguments to be valid pointers event if both buffers are NULL. svn path=/trunk/; revision=13665 --- e-util/e-iconv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'e-util') diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c index 97c290e1c9..531d23efd6 100644 --- a/e-util/e-iconv.c +++ b/e-util/e-iconv.c @@ -387,8 +387,13 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom) cd(printf("using existing iconv converter '%s'\n", ic->conv)); ip = in->ip; if (ip != (iconv_t)-1) { + /* work around some broken iconv implementations + * that die if the length arguments are NULL + */ + size_t buggy_iconv = 0; + /* resets the converter */ - iconv(ip, NULL, NULL, NULL, NULL); + iconv(ip, NULL, &buggy_iconv, NULL, &buggy_iconv); in->busy = TRUE; e_dlist_remove((EDListNode *)in); e_dlist_addhead(&ic->open, (EDListNode *)in); -- cgit v1.2.3