X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=rfc2231.c;h=0fcc85753ba8a712723d199fa2d80ada51abfa62;hp=19a4add0dd15b94ce6974bf41114d18b4d9fedd2;hb=dc2c2ef1ba4d0a0f3c2552459b9f962594a3536b;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/rfc2231.c b/rfc2231.c index 19a4add..0fcc857 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -1,22 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1999-2000 Thomas Roessler * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111, USA. + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ /* @@ -36,9 +24,12 @@ #include "mutt.h" #include "mime.h" #include "charset.h" +#include "lib/str.h" #include "rfc2047.h" #include "rfc2231.h" +#include "lib/mem.h" + #include #include #include @@ -239,7 +230,7 @@ static void rfc2231_list_insert (struct rfc2231_parameter **list, q = p; p = p->next; - c = strcmp (par->value, q->value); + c = mutt_strcmp (par->value, q->value); if ((c > 0) || (c == 0 && par->index >= q->index)) break; } @@ -278,7 +269,7 @@ static void rfc2231_join_continuations (PARAMETER ** head, if (encoded && par->encoded) rfc2231_decode_one (par->value, valp); - vl = strlen (par->value); + vl = mutt_strlen (par->value); safe_realloc (&value, l + vl + 1); strcpy (value + l, par->value); /* __STRCPY_CHECKED__ */ @@ -288,7 +279,7 @@ static void rfc2231_join_continuations (PARAMETER ** head, rfc2231_free_parameter (&par); if ((par = q)) valp = par->value; - } while (par && !strcmp (par->attribute, attribute)); + } while (par && !mutt_strcmp (par->attribute, attribute)); if (value) { if (encoded) @@ -323,10 +314,10 @@ int rfc2231_encode_string (char **pd) if (!Charset || !SendCharset || !(charset = mutt_choose_charset (Charset, SendCharset, - *pd, strlen (*pd), &d, &dlen))) { + *pd, mutt_strlen (*pd), &d, &dlen))) { charset = safe_strdup (Charset ? Charset : "unknown-8bit"); d = *pd; - dlen = strlen (d); + dlen = mutt_strlen (d); } if (!mutt_is_us_ascii (charset)) @@ -339,9 +330,9 @@ int rfc2231_encode_string (char **pd) ++ext; if (encode) { - e = safe_malloc (dlen + 2 * ext + strlen (charset) + 3); + e = safe_malloc (dlen + 2 * ext + mutt_strlen (charset) + 3); sprintf (e, "%s''", charset); /* __SPRINTF_CHECKED__ */ - t = e + strlen (e); + t = e + mutt_strlen (e); for (s = d, slen = dlen; slen; s++, slen--) if (*s < 0x20 || *s >= 0x7f || strchr (MimeSpecials, *s) || strchr ("*'%", *s)) {