Browse Source

Factorize error messages

tags/fmail-0.1.1
Damien Goutte-Gattat 9 years ago
parent
commit
4f65ef9804
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      src/fmail.c

+ 4
- 8
src/fmail.c View File

@@ -458,16 +458,12 @@ read_input_from_editor(void)
int fd;
FILE *f;

if ( asprintf(&filename, "%s/fmailXXXXXX", get_tmp_dir()) == -1 )
if ( asprintf(&filename, "%s/fmailXXXXXX", get_tmp_dir()) == -1
|| (fd = mkstemp(filename)) == -1 )
err(EXIT_FAILURE, "cannot create temporary file");

if ( (fd = mkstemp(filename)) == -1 )
err(EXIT_FAILURE, "cannot create temporary file");

if ( asprintf(&command, "%s %s", get_editor(), filename) == -1 )
err(EXIT_FAILURE, "cannot execute editor");

if ( system(command) == -1 )
if ( asprintf(&command, "%s %s", get_editor(), filename) == -1
|| system(command) == -1 )
err(EXIT_FAILURE, "cannot execute editor");

if ( (f = fdopen(fd, "r")) == NULL )


Loading…
Cancel
Save