summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-07-18 00:58:20 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-07-18 00:58:20 +0000
commit595af7cbcb603de5f69d540a410a2b7107050df5 (patch)
tree6055ccea810a44d0763affa947f6981121c991cb
parent08e8a8d0046de1b3f383b22bdfd3afb443590bcf (diff)
set errno in null cases, just in case.
-rw-r--r--lib/libc/crypt/crypt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c
index 76e02c235aa..ba32d297527 100644
--- a/lib/libc/crypt/crypt.c
+++ b/lib/libc/crypt/crypt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypt.c,v 1.28 2015/05/13 21:01:54 bluhm Exp $ */
+/* $OpenBSD: crypt.c,v 1.29 2015/07/18 00:58:19 tedu Exp $ */
#include <pwd.h>
@@ -10,9 +10,10 @@ crypt(const char *key, const char *setting)
case '2':
return bcrypt(key, setting);
default:
+ errno = EINVAL;
return (NULL);
}
}
-
+ errno = EINVAL;
return (NULL);
}