From 9bebdf2ab37bf912ec617f3089bac67e662dd874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 4 Jun 2021 13:10:28 -0300 Subject: [PATCH] c: print strerror() instead of error code. This changes error() behavior to match what glibc already does. --- include/c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/c.h b/include/c.h index aca88a72..2471209c 100644 --- a/include/c.h +++ b/include/c.h @@ -118,7 +118,7 @@ static void error(int status, int errnum, const char *format, ...) vfprintf(stderr, format, argp); va_end(argp); if (errnum != 0) - fprintf(stderr, ": error code %d", errnum); + fprintf(stderr, ": %s", strerror(errnum)); fprintf(stderr, "\n"); if (status != 0) exit(status);