X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=charset.c;h=ba6b4227b61d68877be5298655917a9d7d99d560;hp=761be88d38124f58208c02eaafec76ba5de649c2;hb=35e39caa19fa050a934e49c1df516cec19c3a4bf;hpb=238b70e39b78f585c586bd51aef41988b3cc73d1 diff --git a/charset.c b/charset.c index 761be88..ba6b422 100644 --- 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);