summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f8437b2)
This fixed "specified bound [n] equals destination size" warnings
found by gcc -Wstringop-truncation.
Also, fixed harmless copy-and-paste error (sizeof(tmpfil) instead
of sizeof(drft) in uip/rcvdist.c) introduced in commit
2f689a1cb.
33 files changed:
- strncpy (adr, ap->text, sizeof(adr));
+ strncpy (adr, ap->text, sizeof(adr) - 1);
pers = ap->pers;
mbox = ap->mbox;
host = ap->host;
pers = ap->pers;
mbox = ap->mbox;
host = ap->host;
ingrp = ap->ingrp;
note = ap->note;
if (ap->err && *ap->err)
ingrp = ap->ingrp;
note = ap->note;
if (ap->err && *ap->err)
- strncpy (err, ap->err, sizeof(err));
+ strncpy (err, ap->err, sizeof(err) - 1);
}
} else {
/* or rename messages with standard prefix */
}
} else {
/* or rename messages with standard prefix */
- strncpy (buf, m_backup (dp), sizeof(buf));
+ strncpy (buf, m_backup (dp), sizeof(buf) - 1);
if (rename (dp, buf) == -1) {
admonish (buf, "unable to rename %s to", dp);
retval = -1;
if (rename (dp, buf) == -1) {
admonish (buf, "unable to rename %s to", dp);
retval = -1;
for (msgnum = mp->lowmsg, hole = 1; msgnum <= mp->hghmsg; msgnum++) {
if (does_exist (mp, msgnum)) {
if (msgnum != hole) {
for (msgnum = mp->lowmsg, hole = 1; msgnum <= mp->hghmsg; msgnum++) {
if (does_exist (mp, msgnum)) {
if (msgnum != hole) {
- strncpy (newmsg, m_name (hole), sizeof(newmsg));
- strncpy (oldmsg, m_name (msgnum), sizeof(oldmsg));
+ strncpy (newmsg, m_name (hole), sizeof(newmsg) - 1);
+ strncpy (oldmsg, m_name (msgnum), sizeof(oldmsg) - 1);
if (verbose)
printf ("message %s becomes %s\n", oldmsg, newmsg);
if (verbose)
printf ("message %s becomes %s\n", oldmsg, newmsg);
if (chdir (m_maildir ("")) < 0) {
advise (m_maildir (""), "chdir");
}
if (chdir (m_maildir ("")) < 0) {
advise (m_maildir (""), "chdir");
}
- strncpy (buffer, m_maildir (folder), sizeof(buffer));
+ strncpy (buffer, m_maildir (folder), sizeof(buffer) - 1);
create_folder (buffer, 0, done);
create_folder (buffer, 0, done);
&& strcmp (folder, DOT)
&& strcmp (folder, DOTDOT)
&& !has_prefix(folder, PWD))) {
&& strcmp (folder, DOT)
&& strcmp (folder, DOTDOT)
&& !has_prefix(folder, PWD))) {
- strncpy (mailfold, folder, sizeof(mailfold));
+ strncpy (mailfold, folder, sizeof(mailfold) - 1);
to interact with the umask. Clear it temporarily. */
saved_umask = umask(0);
to interact with the umask. Clear it temporarily. */
saved_umask = umask(0);
- c = strncpy(path, dir, sizeof(path));
+ c = strncpy(path, dir, sizeof(path) - 1);
bool had_an_error = false;
while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) {
bool had_an_error = false;
while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) {
/* check if the mts.conf file specifies a "localname" */
if (*localname && flag == 0) {
/* check if the mts.conf file specifies a "localname" */
if (*localname && flag == 0) {
- strncpy (buf, localname, sizeof(buffer0));
+ strncpy (buf, localname, sizeof(buffer0) - 1);
} else {
memset(buf, 0, sizeof(buffer0));
/* first get our local name */
} else {
memset(buf, 0, sizeof(buffer0));
/* first get our local name */
/* check if mts.conf file specifies a "systemname" */
if (*systemname) {
/* check if mts.conf file specifies a "systemname" */
if (*systemname) {
- strncpy (buffer, systemname, sizeof(buffer));
+ strncpy (buffer, systemname, sizeof(buffer) - 1);
char *at_sign = strchr (np, '@');
char *right_angle_bracket = strchr (np, '>');
char *at_sign = strchr (np, '@');
char *right_angle_bracket = strchr (np, '>');
- strncpy(localmbox, np, sizeof(localmbox));
+ strncpy(localmbox, np, sizeof(localmbox) - 1);
if (left_angle_bracket && at_sign && right_angle_bracket) {
if (at_sign > left_angle_bracket &&
if (left_angle_bracket && at_sign && right_angle_bracket) {
if (at_sign > left_angle_bracket &&
strncpy(buf, pwd->pw_gecos, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
} else
strncpy(buf, pwd->pw_gecos, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
} else
- strncpy(buf, argv[1], sizeof(buf));
+ strncpy(buf, argv[1], sizeof(buf) - 1);
/*
* Perform the same processing that getuserinfo() does.
/*
* Perform the same processing that getuserinfo() does.
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
die("unable to create temporary file");
}
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
die("unable to create temporary file");
}
- strncpy (tmpfil, cp, sizeof(tmpfil));
+ strncpy (tmpfil, cp, sizeof(tmpfil) - 1);
close (tmpfd);
(void) m_unlink (tmpfil);
} else {
close (tmpfd);
(void) m_unlink (tmpfil);
} else {
- strncpy (buffer, m_backup (file), sizeof(buffer));
+ strncpy (buffer, m_backup (file), sizeof(buffer) - 1);
if (rename (file, buffer) == NOTOK) {
switch (errno) {
case ENOENT: /* unlinked early - no annotations */
if (rename (file, buffer) == NOTOK) {
switch (errno) {
case ENOENT: /* unlinked early - no annotations */
*/
if (inplace) {
for (i = mp->hghmsg; j > msgnum; i--, j--) {
*/
if (inplace) {
for (i = mp->hghmsg; j > msgnum; i--, j--) {
- strncpy (f1, m_name (i), sizeof(f1));
- strncpy (f2, m_name (j), sizeof(f2));
+ strncpy (f1, m_name (i), sizeof(f1) - 1);
+ strncpy (f2, m_name (j), sizeof(f2) - 1);
if (does_exist (mp, j)) {
if (verbosw)
printf ("message %d becomes message %d\n", j, i);
if (does_exist (mp, j)) {
if (verbosw)
printf ("message %d becomes message %d\n", j, i);
die("unable to create temporary file in %s",
get_temp_dir());
}
die("unable to create temporary file in %s",
get_temp_dir());
}
- strncpy (f2, tempfile, sizeof(f2));
- strncpy (f1, m_name (i), sizeof(f1));
+ strncpy (f2, tempfile, sizeof(f2) - 1);
+ strncpy (f1, m_name (i), sizeof(f1) - 1);
if (verbosw && i != msgnum)
printf ("message %d of digest %d becomes message %d\n", j, msgnum, i);
if (verbosw && i != msgnum)
printf ("message %d of digest %d becomes message %d\n", j, msgnum, i);
fclose (out);
if (i == msgnum) {
fclose (out);
if (i == msgnum) {
- strncpy (f3, m_backup (f1), sizeof(f3));
+ strncpy (f3, m_backup (f1), sizeof(f3) - 1);
if (rename (f1, f3) == NOTOK)
admonish (f3, "unable to rename %s to", f1);
if (rename (f1, f3) == NOTOK)
admonish (f3, "unable to rename %s to", f1);
try_it_again:
strncpy (drft, build ? m_maildir ("draft")
try_it_again:
strncpy (drft, build ? m_maildir ("draft")
- : m_draft (dfolder, file, use, &isdf), sizeof(drft));
+ : m_draft (dfolder, file, use, &isdf), sizeof(drft) - 1);
/*
* Check if we have an existing draft
/*
* Check if we have an existing draft
die("can't mix files and folders/msgs");
try_it_again:
die("can't mix files and folders/msgs");
try_it_again:
- strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft));
+ strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft) - 1);
/* Check if draft already exists */
if (stat (drft, &st) != NOTOK) {
/* Check if draft already exists */
if (stat (drft, &st) != NOTOK) {
if (cp == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if (cp == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy(tmpfil, cp, sizeof(tmpfil));
+ strncpy(tmpfil, cp, sizeof(tmpfil) - 1);
if ((out = dup (hdrfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
die("no file descriptors -- you lose big");
if ((out = dup (hdrfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
die("no file descriptors -- you lose big");
get_temp_dir());
}
fchmod(txtfd, 0600);
get_temp_dir());
}
fchmod(txtfd, 0600);
- strncpy (tmpfil, cp, sizeof(tmpfil));
+ strncpy (tmpfil, cp, sizeof(tmpfil) - 1);
if ((out = dup (txtfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
die("no file descriptors -- you lose big");
if ((out = dup (txtfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
die("no file descriptors -- you lose big");
free (path ("./", TFOLDER));
/* get current folder */
free (path ("./", TFOLDER));
/* get current folder */
- strncpy (curfolder, getfolder(1), sizeof(curfolder));
+ strncpy (curfolder, getfolder(1), sizeof(curfolder) - 1);
/* get nmh base directory */
nmhdir = m_maildir ("");
/* get nmh base directory */
nmhdir = m_maildir ("");
if (numfolders > 0) {
/* Update context */
if (numfolders > 0) {
/* Update context */
- strncpy (curfolder, foldersToDo[numfolders - 1], sizeof(curfolder));
+ strncpy (curfolder, foldersToDo[numfolders - 1], sizeof(curfolder) - 1);
context_replace (pfolder, curfolder);/* update current folder */
context_save (); /* save the context file */
context_replace (pfolder, curfolder);/* update current folder */
context_save (); /* save the context file */
inform("no folder given for message %s, continuing...", msg);
readonly_folders (); /* do any readonly folders */
cp = context_find(pfolder);
inform("no folder given for message %s, continuing...", msg);
readonly_folders (); /* do any readonly folders */
cp = context_find(pfolder);
- strncpy (folder, FENDNULL(cp), sizeof(folder));
+ strncpy (folder, FENDNULL(cp), sizeof(folder) - 1);
crawl_folders (".", get_folder_info_callback, NULL);
} else {
crawl_folders (".", get_folder_info_callback, NULL);
} else {
- strncpy (folder, argfolder, sizeof(folder));
+ strncpy (folder, argfolder, sizeof(folder) - 1);
if (get_folder_info (argfolder, msg)) {
context_replace (pfolder, argfolder);/* update current folder */
context_save (); /* save the context file */
if (get_folder_info (argfolder, msg)) {
context_replace (pfolder, argfolder);/* update current folder */
context_save (); /* save the context file */
crawl_folders (folder, get_folder_info_callback, NULL);
}
} else {
crawl_folders (folder, get_folder_info_callback, NULL);
}
} else {
- strncpy (folder, argfolder ? argfolder : getfolder (1), sizeof(folder));
+ strncpy (folder, argfolder ? argfolder : getfolder (1),
+ sizeof(folder) - 1);
/*
* Check if folder exists. If not, then see if
/*
* Check if folder exists. If not, then see if
try_it_again:
strncpy (drft, buildsw ? m_maildir ("draft")
try_it_again:
strncpy (drft, buildsw ? m_maildir ("draft")
- : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft));
+ : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft) - 1);
/* Check if a draft already exists */
if (!buildsw && stat (drft, &st) != NOTOK) {
/* Check if a draft already exists */
if (!buildsw && stat (drft, &st) != NOTOK) {
if (cp == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if (cp == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy (tmpfil, cp, sizeof(tmpfil));
+ strncpy (tmpfil, cp, sizeof(tmpfil) - 1);
(void) m_unlink (tmpfil);
if ((in = dup (fileno (tmp))) == NOTOK)
adios ("dup", "unable to");
(void) m_unlink (tmpfil);
if ((in = dup (fileno (tmp))) == NOTOK)
adios ("dup", "unable to");
die("unable to create temporary file in %s",
get_temp_dir());
}
die("unable to create temporary file in %s",
get_temp_dir());
}
- strncpy (infile, cp, sizeof(infile));
+ strncpy (infile, cp, sizeof(infile) - 1);
/* copy standard input to temporary file */
while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
/* copy standard input to temporary file */
while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
die("unable to create temporary file");
}
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
die("unable to create temporary file");
}
- strncpy(outfile, cp, sizeof(outfile));
+ strncpy(outfile, cp, sizeof(outfile) - 1);
/* output the message */
output_message_fp (ct, fp_out, outfile);
/* output the message */
output_message_fp (ct, fp_out, outfile);
ce->ce_unlink = 1;
if (do_direct() && (buf[0] == '#' && buf[1] == '<')) {
ce->ce_unlink = 1;
if (do_direct() && (buf[0] == '#' && buf[1] == '<')) {
- strncpy (content, buf + 2, sizeof(content));
+ strncpy (content, buf + 2, sizeof(content) - 1);
inlineD = true;
goto rock_and_roll;
}
inlineD = true;
goto rock_and_roll;
}
/* the directive is implicit */
strncpy (content, "text/plain", sizeof(content));
headers = 0;
/* the directive is implicit */
strncpy (content, "text/plain", sizeof(content));
headers = 0;
- strncpy (buffer, (!do_direct() || buf[0] != '#') ? buf : buf + 1, sizeof(buffer));
+ strncpy (buffer, (!do_direct() || buf[0] != '#') ? buf : buf + 1,
+ sizeof(buffer) - 1);
- strncpy (name, parse(), sizeof(name));
+ strncpy (name, parse(), sizeof(name) - 1);
switch (*parptr) {
case '\0':
case ',':
switch (*parptr) {
case '\0':
case ',':
- strncpy (name, parse(), sizeof(name));
+ strncpy (name, parse(), sizeof(name) - 1);
if (!strcasecmp (name, "component")) {
if (ptos (name, &c1->c_text))
if (!strcasecmp (name, "component")) {
if (ptos (name, &c1->c_text))
- strncpy (buffer, cp, sizeof(buffer));
+ strncpy (buffer, cp, sizeof(buffer) - 1);
if (ct->c_termproc) {
char term[BUFSIZ];
if (ct->c_termproc) {
char term[BUFSIZ];
- strncpy (term, buffer, sizeof(term));
+ strncpy (term, buffer, sizeof(term) - 1);
snprintf (buffer, buflen, ct->c_termproc, term);
}
snprintf (buffer, buflen, ct->c_termproc, term);
}
* return (send content to standard output).
*/
if (cp[0] == '-' && cp[1] == '\0') {
* return (send content to standard output).
*/
if (cp[0] == '-' && cp[1] == '\0') {
- strncpy (buffer, cp, buflen);
+ strncpy (buffer, cp, buflen - 1);
if (strncasecmp(response, "SASL ", 5) == 0) {
/* We've seen the SASL capability. Grab the mech list. */
sasl_capability = true;
if (strncasecmp(response, "SASL ", 5) == 0) {
/* We've seen the SASL capability. Grab the mech list. */
sasl_capability = true;
- strncpy(server_mechs, response + 5, server_mechs_size);
+ strncpy(server_mechs, response + 5, server_mechs_size - 1);
die("unable to create temporary file in %s",
get_temp_dir());
}
die("unable to create temporary file in %s",
get_temp_dir());
}
- strncpy(tmpfil, cp, sizeof(tmpfil));
+ strncpy(tmpfil, cp, sizeof(tmpfil) - 1);
if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy (bccfil, tfile, sizeof(bccfil));
+ strncpy (bccfil, tfile, sizeof(bccfil) - 1);
fprintf (out, "From: %s\n", fullfrom);
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
fprintf (out, "From: %s\n", fullfrom);
fprintf (out, "Date: %s\n", dtime (&tclock, 0));
case LOCALHOST:
mbox = lp->m_mbox;
host = lp->m_host;
case LOCALHOST:
mbox = lp->m_mbox;
host = lp->m_host;
- strncpy (addr, mbox, sizeof(addr));
+ strncpy (addr, mbox, sizeof(addr) - 1);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy (tmpfil, tfile, sizeof(tmpfil));
+ strncpy (tmpfil, tfile, sizeof(tmpfil) - 1);
cpydata (fileno (stdin), fileno (fp), "message", tmpfil);
fseek (fp, 0L, SEEK_SET);
cpydata (fileno (stdin), fileno (fp), "message", tmpfil);
fseek (fp, 0L, SEEK_SET);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy (drft, tfile, sizeof(tmpfil));
+ strncpy (drft, tfile, sizeof(drft) - 1);
rcvdistout (fp, form, addrs);
fclose (fp);
rcvdistout (fp, form, addrs);
fclose (fp);
app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
- strncpy (maildir, m_maildir (folder), sizeof(maildir));
+ strncpy (maildir, m_maildir (folder), sizeof(maildir) - 1);
if (chdir (maildir) == NOTOK)
adios (maildir, "unable to change directory to");
if (chdir (maildir) == NOTOK)
adios (maildir, "unable to change directory to");
if (chdir (m_maildir ("")) < 0) {
advise (m_maildir (""), "chdir");
}
if (chdir (m_maildir ("")) < 0) {
advise (m_maildir (""), "chdir");
}
- strncpy (nmaildir, m_maildir (fp->f_name), sizeof(nmaildir));
+ strncpy (nmaildir, m_maildir (fp->f_name), sizeof(nmaildir) - 1);
/*
* Null src_folder indicates that we are refiling a file to
/*
* Null src_folder indicates that we are refiling a file to
try_it_again:
strncpy (drft, buildsw ? m_maildir ("reply")
try_it_again:
strncpy (drft, buildsw ? m_maildir ("reply")
- : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft));
+ : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft) - 1);
/* Check if a draft exists */
if (!buildsw && stat (drft, &st) != NOTOK) {
/* Check if a draft exists */
if (!buildsw && stat (drft, &st) != NOTOK) {
if (cp > newfolder)
*cp = '\0';
else
if (cp > newfolder)
*cp = '\0';
else
- strncpy (newfolder, getfolder(0), sizeof(newfolder));
+ strncpy (newfolder, getfolder(0), sizeof(newfolder) - 1);
- strncpy (newfolder, getfolder(0), sizeof(newfolder));
+ strncpy (newfolder, getfolder(0), sizeof(newfolder) - 1);
if (cp == NULL) {
die("unable to create temporary file");
}
if (cp == NULL) {
die("unable to create temporary file");
}
- if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
+ if (rename (drft, strncpy(file, cp, sizeof(file) - 1)) ==
+ NOTOK)
adios (file, "unable to rename %s to", drft);
drft = file;
}
adios (file, "unable to rename %s to", drft);
drft = file;
}
/* rename the original draft */
if (rename_drft && status == OK &&
rename (drft, strncpy (buffer, m_backup (drft),
/* rename the original draft */
if (rename_drft && status == OK &&
rename (drft, strncpy (buffer, m_backup (drft),
- sizeof(buffer))) == NOTOK)
+ sizeof(buffer) - 1)) == NOTOK)
advise (buffer, "unable to rename %s to", drft);
break;
advise (buffer, "unable to rename %s to", drft);
break;
if (write (out, buf, strlen (buf)) < 0) {
advise (file, "write");
}
if (write (out, buf, strlen (buf)) < 0) {
advise (file, "write");
}
- if (rename (file, strncpy (buf, m_backup (file), sizeof(buf))) == NOTOK)
+ if (rename (file, strncpy (buf, m_backup (file),
+ sizeof(buf) - 1)) == NOTOK)
admonish (buf, "unable to rename %s to", file);
}
}
admonish (buf, "unable to rename %s to", file);
}
}
/* get folder name ready */
if (*string == '+')
/* get folder name ready */
if (*string == '+')
- strncpy(folder, string, sizeof(folder));
+ strncpy(folder, string, sizeof(folder) - 1);
else
snprintf(folder, sizeof(folder), "+%s", string);
else
snprintf(folder, sizeof(folder), "+%s", string);
- strncpy (buffer, envelope + i, sizeof(buffer));
+ strncpy (buffer, envelope + i, sizeof(buffer) - 1);
if ((cp = strchr(buffer, '\n'))) {
*cp = 0;
cp -= 24;
if ((cp = strchr(buffer, '\n'))) {
*cp = 0;
cp -= 24;
return NULL;
/* copy string into temp buffer */
return NULL;
/* copy string into temp buffer */
- strncpy (buffer, cp, sizeof(buffer));
+ strncpy (buffer, cp, sizeof(buffer) - 1);
bp = buffer;
/* skip over leading whitespace */
bp = buffer;
/* skip over leading whitespace */
mlist[msg] = NULL;
old = smsgs[nxt].s_msg;
new = smsgs[msg].s_msg;
mlist[msg] = NULL;
old = smsgs[nxt].s_msg;
new = smsgs[msg].s_msg;
- strncpy (oldname, m_name (old), sizeof(oldname));
+ strncpy (oldname, m_name (old), sizeof(oldname) - 1);
newname = m_name (new);
if (verbose)
printf ("message %d becomes message %d\n", old, new);
newname = m_name (new);
if (verbose)
printf ("message %d becomes message %d\n", old, new);
char newbuf[PATH_MAX + 1];
struct smsg *sp;
char newbuf[PATH_MAX + 1];
struct smsg *sp;
- strncpy (tmpfil, m_name (mp->hghmsg + 1), sizeof(tmpfil));
+ strncpy (tmpfil, m_name (mp->hghmsg + 1), sizeof(tmpfil) - 1);
for (i = 0; i < nmsgs; i++) {
if (! (sp = mlist[i]))
for (i = 0; i < nmsgs; i++) {
if (! (sp = mlist[i]))
*/
old = smsgs[j].s_msg;
new = smsgs[i].s_msg;
*/
old = smsgs[j].s_msg;
new = smsgs[i].s_msg;
- strncpy (f1, m_name (old), sizeof(f1));
+ strncpy (f1, m_name (old), sizeof(f1) - 1);
if (verbose)
printf ("renaming message chain from %d to %d\n", old, new);
if (verbose)
printf ("renaming message chain from %d to %d\n", old, new);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
die("unable to create temporary file in %s", get_temp_dir());
}
- strncpy (tmpfil, tfile, sizeof(tmpfil));
+ strncpy (tmpfil, tfile, sizeof(tmpfil) - 1);
if (!strchr(mailsw, '@'))
mailsw = concat (mailsw, "@", LocalName (0), NULL);
if (!strchr(mailsw, '@'))
mailsw = concat (mailsw, "@", LocalName (0), NULL);
if (altmsg) {
if (mp == NULL || *altmsg == '/' || cwd == NULL)
if (altmsg) {
if (mp == NULL || *altmsg == '/' || cwd == NULL)
- strncpy (altpath, altmsg, sizeof(altpath));
+ strncpy (altpath, altmsg, sizeof(altpath) - 1);
else
snprintf (altpath, sizeof(altpath), "%s/%s", mp->foldpath, altmsg);
if (cwd == NULL)
else
snprintf (altpath, sizeof(altpath), "%s/%s", mp->foldpath, altmsg);
if (cwd == NULL)