diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-08-06 23:57:31 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-08-06 23:57:31 +0000 |
commit | 4737665312e23ff4fb9d681d9acc9aa968eb772a (patch) | |
tree | 37a8ff044541b70531b9d20c4c7dab6fbf4b7543 /lib-src | |
parent | 6baadae0e0028a4f3d9219129caf10baece0df6a (diff) | |
download | emacs-4737665312e23ff4fb9d681d9acc9aa968eb772a.tar.gz |
(main): Fix previous change.
Add error check for empty OUTNAME.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/movemail.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index fd33302b9e6..0cbd426478e 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -160,6 +160,9 @@ main (argc, argv) mmdf_init (argv[0]); #endif + if (*outname == 0) + fatal ("Destination file name is empty", 0); + /* Check access to output file. */ if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) pfatal_with_name (outname); @@ -238,8 +241,9 @@ main (argc, argv) desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); if (desc < 0) { - char *message = (char *) malloc (strlen (tempname) + 50); - sprintf (message, "%s--see source file lib-src/movemail.c"); + char *message = (char *) xmalloc (strlen (tempname) + 50); + sprintf (message, "%s--see source file lib-src/movemail.c", + tempname); pfatal_with_name (message); } close (desc); |