X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sendlib.c;h=7c8ab2bb55e7dcc51ca0ab0670a3ffb1224831e7;hp=4571e7af1e821006b55297d64f09742efa9fd76d;hb=4eaac5c4a87b84ea9ec0668b4e088ac27e2d1106;hpb=59926571aaec3e38cec09d0d9fa34f4a4b887309 diff --git a/sendlib.c b/sendlib.c index 4571e7a..7c8ab2b 100644 --- a/sendlib.c +++ b/sendlib.c @@ -639,7 +639,7 @@ static size_t convert_file_to (FILE * file, const char *fromcode, /* Convert to UTF-8 */ ib = bufi; ob = bufu, obl = sizeof (bufu); - n = iconv (cd1, ibl ? &ib : 0, &ibl, &ob, &obl); + n = my_iconv(cd1, ibl ? &ib : 0, &ibl, &ob, &obl); assert (n == (size_t) (-1) || !n || ICONV_NONTRANS); if (n == (size_t) (-1) && ((errno != EINVAL && errno != E2BIG) || ib == bufi)) { @@ -655,7 +655,7 @@ static size_t convert_file_to (FILE * file, const char *fromcode, if (cd[i] != (iconv_t) (-1) && score[i] != (size_t) (-1)) { ub = bufu, ubl = ubl1; ob = bufo, obl = sizeof (bufo); - n = iconv (cd[i], (ibl || ubl) ? &ub : 0, &ubl, &ob, &obl); + n = my_iconv(cd[i], (ibl || ubl) ? &ub : 0, &ubl, &ob, &obl); if (n == (size_t) (-1)) { assert (errno == E2BIG || (BUGGY_ICONV && (errno == EILSEQ || errno == ENOENT))); @@ -1612,19 +1612,13 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach, } if (mode == 0 && !privacy && option (OPTXMAILER) && !has_agent) { - struct utsname un; - char *os; + const char *os; if (OperatingSystem != NULL) { os = OperatingSystem; - } - else { - if (uname (&un) == -1) { - os = "UNIX"; - } - else { - os = un.sysname; - } + } else { + struct utsname un; + os = (uname(&un) == -1) ? "UNIX" : un.sysname; } /* Add a vanity header */ fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version (0), os); @@ -1964,13 +1958,14 @@ static char **add_args (char **args, size_t * argslen, size_t * argsmax, return (args); } -static char **add_option (char **args, size_t * argslen, size_t * argsmax, - char *s) +static char **add_option(const char **args, size_t * argslen, size_t * argsmax, + const char *s) { - if (*argslen == *argsmax) - mem_realloc (&args, (*argsmax += 5) * sizeof (char *)); - args[(*argslen)++] = s; - return (args); + if (*argslen == *argsmax) { + mem_realloc(&args, (*argsmax += 5) * sizeof (char *)); + } + args[(*argslen)++] = s; + return (args); } static int mutt_invoke_sendmail (ADDRESS * from, /* the sender */ @@ -2503,7 +2498,7 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, rewind (tempfp); while (fgets (sasha, sizeof (sasha), tempfp) != NULL) lines++; - fprintf (msg->fp, "Content-Length: " OFF_T_FMT "\n", ftello (tempfp)); + fprintf (msg->fp, "Content-Length: %zd\n", ftello (tempfp)); fprintf (msg->fp, "Lines: %d\n\n", lines); /* copy the body and clean up */