summaryrefslogtreecommitdiffstats
path: root/lib/libc/crypt/crypt.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-07-18 00:58:19 +0000
committertedu <tedu@openbsd.org>2015-07-18 00:58:19 +0000
commit09e42fae479e57045996541e302d8f8923988468 (patch)
tree6e26243210e2d13b02fd3cf708ed7d9eb06c97d6 /lib/libc/crypt/crypt.c
parentstandards compliant error return (null). will make ruby happier, at least. (diff)
downloadwireguard-openbsd-09e42fae479e57045996541e302d8f8923988468.tar.xz
wireguard-openbsd-09e42fae479e57045996541e302d8f8923988468.zip
set errno in null cases, just in case.
Diffstat (limited to 'lib/libc/crypt/crypt.c')
-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);
}