From 502b7c1eea6ebd6aa25bf3b54f1e9d82d1035fb1 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 29 Oct 2022 13:34:05 +0200 Subject: [PATCH] DRAFT lib: strerror: Fix typo, fix static message. * lib/string/strerror.c (strerror): Fix typo, always show error number. --- lib/string/strerror.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/string/strerror.c b/lib/string/strerror.c index ef176a42..bf00e76f 100644 --- a/lib/string/strerror.c +++ b/lib/string/strerror.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen + * Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -77,5 +77,7 @@ strerror (int errnum) } if (errnum > 0 && errnum <= sys_nerr) return sys_errlist[errnum]; - return "sterror: unknown error"; + static char buf[40] = "strerror: unknown error: "; + strcat (buf, itoa (errnum)); + return buf; }