/*
+ * Copyright notice from original mutt:
* Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
*
- * 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.
*/
#if HAVE_CONFIG_H
#include "mutt.h"
#include "charset.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
#ifndef EILSEQ
# define EILSEQ EINVAL
#endif
for (i = 0; PreferredMIMENames[i].key; i++)
if (!ascii_strcasecmp (scratch, PreferredMIMENames[i].key) ||
- !mutt_strcasecmp (scratch, PreferredMIMENames[i].key)) {
+ !safe_strcasecmp (scratch, PreferredMIMENames[i].key)) {
strfcpy (dest, PreferredMIMENames[i].pref, dlen);
return;
}
for (t = inrepls; *t; t++) {
ICONV_CONST char *ib1 = *t;
- size_t ibl1 = strlen (*t);
+ size_t ibl1 = safe_strlen (*t);
char *ob1 = ob;
size_t obl1 = obl;
outrepl = "?";
iconv (cd, 0, 0, &ob, &obl);
if (obl) {
- int n = strlen (outrepl);
+ int n = safe_strlen (outrepl);
if (n > obl) {
outrepl = "?";
else
outrepl = "?";
- len = strlen (s);
+ len = safe_strlen (s);
ib = s, ibl = len + 1;
obl = MB_LEN_MAX * ibl;
ob = buf = safe_malloc (obl + 1);
FREE (ps);
*ps = buf;
- mutt_str_adjust (ps);
+ str_adjust (ps);
return 0;
}
else
const char *c, *c1;
c = charset;
- if (!mutt_strlen (c))
+ if (!safe_strlen (c))
return "us-ascii";
if (!(c1 = strchr (c, ':')))
return charset;
char *s;
char *fromcode;
size_t m, n;
- size_t ulen = mutt_strlen (*ps);
+ size_t ulen = safe_strlen (*ps);
size_t slen;
if (!u || !*u)
return 0;
c1 = strchr (c, ':');
- n = c1 ? c1 - c : mutt_strlen (c);
+ n = c1 ? c1 - c : safe_strlen (c);
if (!n)
continue;
fromcode = safe_malloc (n + 1);