]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
iconv_t isn't necessarily pointer.
authorTimo Sirainen <tss@iki.fi>
Mon, 10 May 2004 00:59:27 +0000 (03:59 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 10 May 2004 00:59:27 +0000 (03:59 +0300)
--HG--
branch : HEAD

src/lib-charset/charset-iconv.c

index ed2c039ee0456072d232b8dbaa41308c04199129..9520f0b3b7d3dd13008e9d496b6efab5df87861e 100644 (file)
@@ -26,11 +26,11 @@ struct charset_translation *charset_to_utf8_begin(const char *charset,
 
        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 @@ struct charset_translation *charset_to_utf8_begin(const char *charset,
 
 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 @@ charset_to_ucase_utf8(struct charset_translation *t,
        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;