summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-10-20 09:09:50 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-10-20 09:09:50 +0000
commit042accda8756a8cc09eef91987195eaeed4421d1 (patch)
tree820cafab6fa1df65aa2a4d2ab75401a23477780a /lib/libc
parentbbc70e8c46cf25c9d641c179234bc4eb6eb191ab (diff)
A library should not return EFAULT. Just segfault if a bogus or
NULL pointer is passed in. ok espie@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/setrunelocale.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 6e8d2fa17f4..47a47b9042d 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setrunelocale.c,v 1.1 2005/08/07 10:16:24 espie Exp $ */
+/* $OpenBSD: setrunelocale.c,v 1.2 2005/10/20 09:09:49 otto Exp $ */
/* $NetBSD: setrunelocale.c,v 1.14 2003/08/07 16:43:07 agc Exp $ */
/*-
@@ -137,10 +137,8 @@ _newrunelocale(const char *path)
FILE *fp;
_RuneLocale *rl;
- /* path may be NULL (actually, it's checked below) */
-
- if (!path || strlen(path) + 1 > sizeof(lt->path))
- return EFAULT;
+ if (strlen(path) + 1 > sizeof(lt->path))
+ return EINVAL;
rl = _findrunelocale(path);
if (rl)