commit - 20f14b0535210d92e410e81f6db5c4e17b578991
commit + 16bb8d07c235e9ba35ff897be9a59e3cc7cbdc79
blob - 38c7a81414b89c6734f11e574b83f20ef8715498
blob + 0b44afa542258dccd3bd55e226bd3dd398a74e18
--- FICS/utils.c
+++ FICS/utils.c
char tmp[MAX_LINE_SIZE];
int num;
+ if (command == NULL || strcmp(command, "") == 0) {
+ warnx("%s: error: no command", __func__);
+ return -1;
+ }
+
if (input)
fp = popen(command, "w");
else
fp = popen(command, "r");
- if (!fp)
+ if (fp == NULL)
return -1;
if (input) {
}
}
- pclose(fp);
- return 0;
+ return (pclose(fp) == -1 ? -1 : 0);
}
PUBLIC char *