muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
$(top_builddir)/lib-lib/liblib.a \
+ $(top_builddir)/lib-hash/libhash.a \
$(top_builddir)/lib/libsane.a \
$(LIBIMAPDEPS) $(LIBPOPDEPS) $(LIBNNTPDEPS) $(INTLDEPS)
makedoc_SOURCES = makedoc.c
-makedoc_LDADD =
-makedoc_DEPENDENCIES =
-
-# $(makedoc_OBJECTS): $(makedoc_SOURCES)
-# $(HOST_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $<
-
-# makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
-# @rm -rf makedoc
-# $(HOST_CC) $(AM_CFLAGS) $(LDFLAGS) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) -o makedoc
+makedoc_LDADD = -Llib-lib -llib
+makedoc_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
CPP=@CPP@
regex.c mutt_libesmtp.h crypt-gpgme.h
muttng_dotlock_SOURCES = dotlock.c
-muttng_dotlock_LDADD = @LIBOBJS@
-muttng_dotlock_DEPENDENCIES = @LIBOBJS@
+muttng_dotlock_LDADD = -Llib-lib -llib @LIBOBJS@
+muttng_dotlock_DEPENDENCIES = @LIBOBJS@ $(top_builddir)/lib-lib/liblib.a
pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c pgppacket.c
-pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) -Llib-lib -llib -Llib-hash -lhash -Llib -lsane
-pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS)
+pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) \
+ -Llib-lib -llib -Llib-hash -lhash -Llib -lsane
+pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) \
+ $(top_builddir)/lib-lib/liblib.a \
+ $(top_builddir)/lib-hash/libhash.a
pgpewrapng_SOURCES = pgpewrap.c
pgpewrapng_LDADD =
if (!type)
snprintf (_type, sizeof (_type), "%s/%s", TYPE (b), b->subtype);
else
- strncpy (_type, type, sizeof (_type));
+ m_strcpy(_type, sizeof(_type), type);
mutt_check_lookup_list (b, _type, sizeof (_type));
type = _type;
break;
case 'f':
- strncpy (fn, folder->ff->name, sizeof (fn) - 1);
+ m_strcpy(fn, sizeof(fn), folder->ff->name);
snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
snprintf (dest, destlen, tmp, fn);
break;
for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--);
if (i > 0) {
if (f[0] == '/') {
- if (i > sizeof (LastDir) - 1)
- i = sizeof (LastDir) - 1;
- strncpy (LastDir, f, i);
- LastDir[i] = 0;
+ i = MIN(sizeof(LastDir) - 1, i);
+ m_strcpy(LastDir, sizeof(LastDir), f);
}
else {
getcwd (LastDir, sizeof (LastDir));
else {
*p = 0;
len = (size_t) (p - s);
- strncpy (dirpart, s, len);
+ memcpy(dirpart, s, len);
dirpart[len] = 0;
p++;
strfcpy (filepart, p, sizeof (filepart));
break;
case 'v':
- strncpy (buf, mutt_make_version (0), buflen);
+ m_strcpy(buf, buflen, mutt_make_version (0));
break;
case 0:
if (result) {
algorithm_name = gpgme_hash_algo_name (result->signatures->hash_algo);
if (algorithm_name) {
- strncpy (buf, algorithm_name, buflen - 1);
- buf[buflen - 1] = 0;
+ m_strcpy(buf, buflen, algorithm_name);
}
}
#endif
{
if (Context && Context->path)
- strncpy (buf, Context->path, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), Context->path);
if (op != OP_SIDEBAR_OPEN)
buffy_next (buf, sizeof (buf));
}
if (op == OP_SIDEBAR_OPEN) {
- strncpy (buf, NONULL(sidebar_get_current ()), sizeof (buf));
+ m_strcpy(buf, sizeof(buf), sidebar_get_current());
}
else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) {
if (menu->menu == MENU_PAGER) {
# define LONG_STRING 1024
# define MAXLOCKATTEMPT 5
-# define strfcpy(A,B,C) strncpy (A,B,C), *(A+(C)-1)=0
+# define strfcpy(A,B,C) m_strcpy(A,C,B)
# ifdef USE_SETGID
break;
case 'r':
if (*p) {
- strncpy (tmp, p, sizeof (tmp));
+ m_strcpy(tmp, sizeof(tmp), p);
mutt_expand_path (tmp, sizeof (tmp));
buf = be_snarf_file (tmp, buf, &bufmax, &buflen, 1);
}
time.tm_sec = 0;
time.tm_min = 0;
time.tm_hour = 12;
- strncpy (tstr, p, 11);
+ m_strcpy(tstr, sizeof(tstr), p);
tstr[4] = '\0';
time.tm_year = atoi (tstr) - 1900;
tstr[7] = '\0';
if (!h)
return NULL;
- strncpy(path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
str_cat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
str_cat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
str_cat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
return NULL;
}
- strncpy (path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
strncat (path, filename, sizeof (path) - m_strlen(path));
key.dptr = path;
return -1;
}
- strncpy (path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
strncat (path, filename, sizeof (path) - m_strlen(path));
key.dptr = path;
return -1;
}
- strncpy (path, h->folder, sizeof (path));
+ m_strcpy(path, sizeof(path), h->folder);
strncat (path, filename, sizeof (path) - m_strlen(path));
key.dptr = path;
imap_fix_path (idata, mx.mbox, mbox, sizeof (mbox));
imap_munge_mbox_name (buf, sizeof (buf), mbox);
imap_unquote_string (buf); /* As kludgy as it gets */
- mbox[sizeof (mbox) - 1] = '\0';
- strncpy (mbox, buf, sizeof (mbox) - 1);
+ m_strcpy(mbox, sizeof(mbox), buf);
n = m_strlen(mbox);
debug_print (3, ("mbox: %s\n", mbox));
buf = m_strdup(s);
if (buf) {
imap_utf7_decode (&buf);
- strncpy (s, buf, m_strlen(s));
+ m_strcpy(s, m_strlen(s) + 1, buf);
}
p_delete(&buf);
Matches[(numtabs - 2) % Num_matched]);
/* return the completed command */
- strncpy (buffer, Completed, len - spaces);
+ m_strcpy(buffer, len - spaces, Completed);
}
else if (!str_ncmp (buffer, "set", 3)
|| !str_ncmp (buffer, "unset", 5)
snprintf (Completed, sizeof(Completed), "%s",
Matches[(numtabs - 2) % Num_matched]);
- strncpy (pt, Completed, buffer + len - pt - spaces);
+ m_strcpy(pt, buffer + len - pt - spaces, Completed);
}
else if (!str_ncmp (buffer, "exec", 4)) {
struct binding_t *menu = km_get_table (CurrentMenu);
snprintf (Completed, sizeof(Completed), "%s",
Matches[(numtabs - 2) % Num_matched]);
- strncpy (pt, Completed, buffer + len - pt - spaces);
+ m_strcpy(pt, buffer + len - pt - spaces, Completed);
}
else
return 0;
# define ISSPACE(c) isspace((unsigned char)c)
# define ISBLANK(c) (c == ' ' || c == '\t')
-# define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0
+# define strfcpy(A,B,C) m_strcpy(A,C,B)
/* this macro must check for *c == 0 since isspace(0) has
* unreliable behavior on some systems */
# define SKIPWS(c) while (*(c) && isspace ((unsigned char) *(c))) c++;
#include <ctype.h>
#include <errno.h>
+#include <lib-lib/str.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
if (!strcmp (buff, "}"))
break;
- strncpy (val + STRLEN (val), buff, sizeof (val) - STRLEN (val));
+ m_strcat(val, sizeof(val), buff);
}
while ((s = get_token (buff, sizeof (buff), s)));
static void menu_make_entry (char *s, int l, MUTTMENU * menu, int i)
{
if (menu->dialog) {
- strncpy (s, menu->dialog[i], l);
+ m_strcpy(s, l, menu->dialog[i]);
menu->current = -1; /* hide menubar */
}
else
switch (op) {
case 's':
- strncpy (fn, NewsServer, sizeof (fn) - 1);
+ m_strcpy(fn, sizeof (fn), NewsServer);
str_tolower (fn);
snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
snprintf (dest, destlen, tmp, fn);
* via rename(2); as dirname(2) may modify its argument,
* temporarily use buf as copy of it
*/
- strncpy (buf, filename, sizeof (buf));
- strncpy (tmpfile, basename (filename), sizeof (tmpfile));
+ m_strcpy(buf, sizeof(buf), filename);
+ m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));
debug_print (1, ("Opening %s\n", tmpfile));
if (!(ofp = fopen (tmpfile, "w"))) {
if (!unread)
continue;
}
- strncpy (dst, data->group, dstlen);
+ m_strcpy(dst, dstlen, data->group);
break;
}
}
if (ascii_strncasecmp ("subject:", uh->data, 8) == 0) {
p = uh->data + 8;
SKIPWS (p);
- strncpy (buf, p, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), p);
}
}
}
shortened = 1;
}
- snprintf (entry, len-lencnt, "%s", box);
+ m_strcpy(entry, len - lencnt, box);
entry[m_strlen(entry)] = ' ';
- strncpy (entry + (len - lencnt), no, lencnt);
+ m_strcpy(entry + (len - lencnt), lencnt, no);
addnstr (entry, len);
Table[cur].hash = hash;
Table[cur].suffix = hash_suffix;
- strncpy (Table[cur].email, fields[0], sizeof (Table[cur].email));
- strncpy (Table[cur].nick, fields[2], sizeof (Table[cur].nick));
+ m_strcpy(Table[cur].email, sizeof(Table[cur].email), fields[0]);
+ m_strcpy(Table[cur].nick, sizeof(Table[cur].nick), fields[2]);
Table[cur].trust = *fields[4];
Table[cur].public = public;
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
- strncpy (fa, mutt_get_name ((*ppa)->env->to), sizeof (fa));
- fa[sizeof (fa) - 1] = '\0';
-
- strncpy (fb, mutt_get_name ((*ppb)->env->to), sizeof (fb));
- fb[sizeof (fb) - 1] = '\0';
+ m_strcpy(fa, sizeof(fa), mutt_get_name((*ppa)->env->to));
+ m_strcpy(fb, sizeof(fb), mutt_get_name((*ppb)->env->to));
result = str_casecmp (fa, fb);
AUXSORT (result, a, b);
* On the next call that pointer may get smashed so we copy the return value
* to our own memory space. */
- strncpy (fa, mutt_get_name ((*ppa)->env->from), sizeof (fa));
- fa[sizeof (fa) - 1] = '\0';
-
- strncpy (fb, mutt_get_name ((*ppb)->env->from), sizeof (fb));
- fb[sizeof (fb) - 1] = '\0';
+ m_strcpy(fa, sizeof(fa), mutt_get_name((*ppa)->env->from));
+ m_strcpy(fb, sizeof(fb), mutt_get_name((*ppb)->env->from));
result = str_casecmp (fa, fb);
AUXSORT (result, a, b);
break;
case 'v':
- strncpy (buf, mutt_make_version (0), buflen);
+ m_strcpy(buf, buflen, mutt_make_version(0));
break;
case 'V':
myarrow[width + 1] = 0;
new_tree = p_new(char, (2 + depth * width));
if (start_depth > 1) {
- strncpy (new_tree, pfx, (start_depth - 1) * width);
+ memcpy(new_tree, pfx, (start_depth - 1) * width);
strfcpy (new_tree + (start_depth - 1) * width,
arrow, (1 + depth - start_depth) * width + 2);
}