From: Todd C. Miller Date: Fri, 14 Dec 2001 19:56:48 +0000 (+0000) Subject: Return EINVAL if errnum > sys_nerr X-Git-Tag: SUDO_1_6_4~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0315c59ea26c21232fed5c91622929293ad3ad7;p=sudo Return EINVAL if errnum > sys_nerr --- 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"); }