]> granicus.if.org Git - sudo/commitdiff
Return EINVAL if errnum > sys_nerr
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Dec 2001 19:56:48 +0000 (19:56 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Dec 2001 19:56:48 +0000 (19:56 +0000)
strerror.c

index ae0d5a88b9bba7760b44bae2bd4ed004acb9ad7b..8181acf70d9a5d46b65b7e71f9531ba45eff9f78 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999, 2001 Todd C. Miller <Todd.Miller@courtesan.com>
  * 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");
 }