npc(1): uses perror(3)

This commit is contained in:
Emma Tebibyte 2024-08-10 19:09:26 -06:00
parent ea2efdf5b9
commit d6d9c2088e
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -22,11 +22,6 @@
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_OSERR, EX_USAGE */
#include <unistd.h> /* pledge(2), getopt(3) */
#ifdef __OpenBSD__
# include <errno.h> /* errno */
# include <string.h> /* strerror(3) */
#endif
char *program_name = "npc";
static int
@ -48,7 +43,7 @@ int main(int argc, char *argv[]) {
program_name = argv[0] == NULL ? program_name : argv[0];
if (pledge("stdio", NULL) == -1) {
(void)fprintf(stderr, "%s: %s\n", program_name, strerror(errno));
perror(program_name);
return EX_OSERR;
}
#endif