diff options
| author | Richard M. Stallman | 1995-08-06 23:57:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-08-06 23:57:31 +0000 |
| commit | af7bd34e27296229035ed87435f2d741e2700591 (patch) | |
| tree | 25d0db13b8413d6c3768f5b6eb5db5e022e822e7 /lib-src | |
| parent | 84faf44c96f3ab75f115636a2bab3d230b22f829 (diff) | |
| download | emacs-af7bd34e27296229035ed87435f2d741e2700591.tar.gz emacs-af7bd34e27296229035ed87435f2d741e2700591.zip | |
(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) | |||
| 160 | mmdf_init (argv[0]); | 160 | mmdf_init (argv[0]); |
| 161 | #endif | 161 | #endif |
| 162 | 162 | ||
| 163 | if (*outname == 0) | ||
| 164 | fatal ("Destination file name is empty", 0); | ||
| 165 | |||
| 163 | /* Check access to output file. */ | 166 | /* Check access to output file. */ |
| 164 | if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) | 167 | if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) |
| 165 | pfatal_with_name (outname); | 168 | pfatal_with_name (outname); |
| @@ -238,8 +241,9 @@ main (argc, argv) | |||
| 238 | desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); | 241 | desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); |
| 239 | if (desc < 0) | 242 | if (desc < 0) |
| 240 | { | 243 | { |
| 241 | char *message = (char *) malloc (strlen (tempname) + 50); | 244 | char *message = (char *) xmalloc (strlen (tempname) + 50); |
| 242 | sprintf (message, "%s--see source file lib-src/movemail.c"); | 245 | sprintf (message, "%s--see source file lib-src/movemail.c", |
| 246 | tempname); | ||
| 243 | pfatal_with_name (message); | 247 | pfatal_with_name (message); |
| 244 | } | 248 | } |
| 245 | close (desc); | 249 | close (desc); |