Mercurial > dovecot > original-hg > dovecot-1.2
changeset 1991:689f791b480f HEAD
iconv_t isn't necessarily pointer.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 10 May 2004 03:59:27 +0300 |
parents | 049502ef137e |
children | 63e67430b580 |
files | src/lib-charset/charset-iconv.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-charset/charset-iconv.c Mon May 10 03:45:45 2004 +0300 +++ b/src/lib-charset/charset-iconv.c Mon May 10 03:59:27 2004 +0300 @@ -26,11 +26,11 @@ if (strcasecmp(charset, "us-ascii") == 0 || strcasecmp(charset, "ascii") == 0) { - cd = NULL; + cd = (iconv_t)-1; ascii = TRUE; } else if (strcasecmp(charset, "UTF-8") == 0 || strcasecmp(charset, "UTF8") == 0) { - cd = NULL; + cd = (iconv_t)-1; ascii = FALSE; } else { ascii = FALSE; @@ -50,14 +50,14 @@ void charset_to_utf8_end(struct charset_translation *t) { - if (t->cd != NULL) + if (t->cd != (iconv_t)-1) iconv_close(t->cd); i_free(t); } void charset_to_utf8_reset(struct charset_translation *t) { - if (t->cd != NULL) + if (t->cd != (iconv_t)-1) (void)iconv(t->cd, NULL, NULL, NULL, NULL); } @@ -74,7 +74,7 @@ destpos = buffer_get_used_size(dest); destleft = buffer_get_size(dest) - destpos; - if (t->cd == NULL) { + if (t->cd == (iconv_t)-1) { /* no translation needed - just copy it to outbuf uppercased */ if (*src_size > destleft) *src_size = destleft;