Pārlūkot izejas kodu

Factorize error messages

master
Damien Goutte-Gattat pirms 9 gadiem
vecāks
revīzija
4f65ef9804
1 mainītis faili ar 4 papildinājumiem un 8 dzēšanām
  1. +4
    -8
      src/fmail.c

+ 4
- 8
src/fmail.c Parādīt failu

@ -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 )


Notiek ielāde…
Atcelt
Saglabāt