From e0315c59ea26c21232fed5c91622929293ad3ad7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 14 Dec 2001 19:56:48 +0000 Subject: [PATCH] Return EINVAL if errnum > sys_nerr --- strerror.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/strerror.c b/strerror.c index ae0d5a88b..8181acf70 100644 --- a/strerror.c +++ b/strerror.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Todd C. Miller + * Copyright (c) 1999, 2001 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,6 @@ strerror(n) if (n > 0 && n < sys_nerr) return(sys_errlist[n]); - else - return("Unknown error"); + errno = EINVAL; + return("Unknown error"); } -- 2.40.0