Parcourir la source

Check return value of pclose()

master
Laslo Hunhold il y a 6 ans
committed by Aaron Marcher
Parent
révision
b640cc489b
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. +4
    -1
      components/run_command.c

+ 4
- 1
components/run_command.c Voir le fichier

@@ -16,7 +16,10 @@ run_command(const char *cmd)
return NULL;
}
p = fgets(buf, sizeof(buf) - 1, fp);
pclose(fp);
if (pclose(fp) < 0) {
warn("pclose '%s':", cmd);
return NULL;
}
if (!p) {
return NULL;
}


Chargement…
Annuler
Enregistrer