From: Ralph Corderoy Date: Sun, 16 Apr 2017 22:49:00 +0000 (+0100) Subject: Replace add(nonnull, NULL) with mh_xstrdup(nonnull). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/b28c59528986bca109750b6f683263bd5ffd19d5?hp=d3bc59068db8bcc73c26ca70c5fdfb88eb1dd9d3 Replace add(nonnull, NULL) with mh_xstrdup(nonnull). Only a few cases where it's obvious that the first parameter will not be NULL. --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index c8b8799c..9b733e85 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -993,7 +993,7 @@ use_forw: /* else, use the current folder */ if (!folder) - folder = add (getfolder (1), NULL); + folder = mh_xstrdup(getfolder(1)); if (!(mp = folder_read (folder, 0))) adios (NULL, "unable to read folder %s", folder); diff --git a/uip/mhn.c b/uip/mhn.c index a3f10305..2867f98a 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -370,7 +370,7 @@ do_cache: /* * Cache the current directory before we do any chdirs()'s. */ - cwd = add(pwd(), NULL); + cwd = mh_xstrdup(pwd()); if (!context_find ("path")) free (path ("./", TFOLDER)); diff --git a/uip/mhstore.c b/uip/mhstore.c index 98e62396..81d30a1b 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -266,7 +266,7 @@ do_cache: /* * Cache the current directory before we do any chdirs()'s. */ - cwd = add(pwd(), NULL); + cwd = mh_xstrdup(pwd()); if (!context_find ("path")) free (path ("./", TFOLDER)); diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index c9725ffd..7604c210 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -584,7 +584,7 @@ store_content (CT ct, CT p, mhstoreinfo_t info) create_folder(m_mailpath(folder), 0, exit); /* Record the folder name */ - ct->c_folder = add (folder, NULL); + ct->c_folder = mh_xstrdup(folder); if (cp[1]) free (folder);