]> diplodocus.org Git - nmh/blobdiff - uip/mhstoresbr.c
Deference char pointer to test for empty string instead of strlen(3).
[nmh] / uip / mhstoresbr.c
index 62b2f4afa72cac556bbf3b89a7db9b4bba85480c..9869914be1c3ccb5feba5fe4223a5b857a0d9be8 100644 (file)
@@ -42,8 +42,9 @@ struct mhstoreinfo {
 
 mhstoreinfo_t
 mhstoreinfo_create (CT *ct, char *pwd, const char *csw, int asw, int vsw) {
-    mhstoreinfo_t info = mh_xmalloc (sizeof *info);
+    mhstoreinfo_t info;
 
+    NEW(info);
     info->cts = ct;
     info->cwd = pwd;
     info->autosw = asw;
@@ -344,9 +345,7 @@ store_partial (CT ct, mhstoreinfo_t info)
        return NOTOK;
     }
 
-    if ((base = (CT *) mh_xcalloc ((size_t) (i + 1), sizeof(*base))) == NULL)
-       adios (NULL, "out of memory");
-
+    base = mh_xcalloc(i + 1, sizeof *base);
     ctq = base;
     for (ctp = info->cts; *ctp; ctp++) {
        p = *ctp;
@@ -1285,7 +1284,7 @@ clobber_check (char *original_file, mhstoreinfo_t info) {
           if (isatty (fileno (stdin))) {
             char *prompt =
               concat ("Overwrite \"", file, "\" [y/n/rename]? ", NULL);
-            ans = getans (prompt, answer);
+            ans = read_switch_multiword (prompt, answer);
             free (prompt);
           } else {
             /* Overwrite, that's what nmh used to do.  And warn. */