]> diplodocus.org Git - nmh/commitdiff
Replace add(nonnull, NULL) with mh_xstrdup(nonnull).
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 16 Apr 2017 22:49:00 +0000 (23:49 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 16 Apr 2017 22:49:00 +0000 (23:49 +0100)
Only a few cases where it's obvious that the first parameter will not be
NULL.

uip/mhbuildsbr.c
uip/mhn.c
uip/mhstore.c
uip/mhstoresbr.c

index c8b8799ccf8c32fc1cd982b6c6a1bd2bc8850fac..9b733e8571152b6a1eb02dba770a31248fdbd62b 100644 (file)
@@ -993,7 +993,7 @@ use_forw:
 
        /* else, use the current folder */
        if (!folder)
 
        /* 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);
 
        if (!(mp = folder_read (folder, 0)))
            adios (NULL, "unable to read folder %s", folder);
index a3f10305b74d9e1367b2c97503e94a3ab809d15d..2867f98a8fac26cb474ef4f4381d2c33d938f393 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -370,7 +370,7 @@ do_cache:
     /*
      * Cache the current directory before we do any chdirs()'s.
      */
     /*
      * 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));
 
     if (!context_find ("path"))
        free (path ("./", TFOLDER));
index 98e6239675592185cba448e156b67f68fa0bb014..81d30a1b3f058f7f5c9b1db1dc618be6f7eb18dd 100644 (file)
@@ -266,7 +266,7 @@ do_cache:
     /*
      * Cache the current directory before we do any chdirs()'s.
      */
     /*
      * 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));
 
     if (!context_find ("path"))
        free (path ("./", TFOLDER));
index c9725ffdee4c239f83a1f40316b429152b3af62a..7604c210d4849921303de69a1197ed78546a1ab2 100644 (file)
@@ -584,7 +584,7 @@ store_content (CT ct, CT p, mhstoreinfo_t info)
            create_folder(m_mailpath(folder), 0, exit);
 
            /* Record the folder name */
            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);
 
            if (cp[1])
                free (folder);