DRAFT lib: strerror: Fix typo, fix static message.

* lib/string/strerror.c (strerror): Fix typo, always show error number.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-10-29 13:34:05 +02:00
parent 7cbe2b1152
commit 502b7c1eea
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*- /* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software * GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> * Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* *
* This file is part of GNU Mes. * This file is part of GNU Mes.
* *
@ -77,5 +77,7 @@ strerror (int errnum)
} }
if (errnum > 0 && errnum <= sys_nerr) if (errnum > 0 && errnum <= sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
return "sterror: unknown error"; static char buf[40] = "strerror: unknown error: ";
strcat (buf, itoa (errnum));
return buf;
} }