stop building doc/ atm
[apps/madmutt.git] / charset.c
index 761be88..ba6b422 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -336,7 +336,7 @@ size_t mutt_iconv (iconv_t cd, const char **inbuf, size_t * inbytesleft,
         outrepl = "?";
       my_iconv(cd, 0, 0, &ob, &obl);
       if (obl) {
-        int n = m_strlen(outrepl);
+        size_t n = m_strlen(outrepl);
 
         if (n > obl) {
           outrepl = "?";
@@ -399,8 +399,6 @@ int mutt_convert_string (char **ps, const char *from, const char *to,
 
     p_delete(ps);
     *ps = buf;
-
-    str_adjust (ps);
     return 0;
   }
   else
@@ -448,7 +446,7 @@ FGETCONV *fgetconv_open (FILE * file, const char *from, const char *to,
     fc->inrepls = mutt_is_utf8 (to) ? repls : repls + 1;
   }
   else
-    fc = p_new(struct fgetconv_not, 1);
+    fc = p_new(struct fgetconv_s, 1);
   fc->file = file;
   fc->cd = cd;
   return (FGETCONV *) fc;
@@ -556,7 +554,8 @@ static size_t convert_string (const char *f, size_t flen,
 {
   iconv_t cd;
   char *buf, *ob;
-  size_t obl, n;
+  size_t obl;
+  ssize_t n;
   int e;
 
   cd = mutt_iconv_open (to, from, 0);
@@ -565,7 +564,7 @@ static size_t convert_string (const char *f, size_t flen,
   obl = 4 * flen + 1;
   ob = buf = xmalloc(obl);
   n = my_iconv(cd, &f, &flen, &ob, &obl);
-  if (n == (size_t) (-1) || my_iconv(cd, 0, 0, &ob, &obl) == (size_t) (-1)) {
+  if (n < 0 || my_iconv(cd, 0, 0, &ob, &obl) < 0) {
     e = errno;
     p_delete(&buf);
     iconv_close (cd);