summaryrefslogtreecommitdiff
path: root/lib/libc/nls/catgets.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 06:21:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 06:21:50 +0000
commitbe87ca8f925f66bcca2026f65192c33bc3cb1ea4 (patch)
tree0029a5a48080c89cd0f3612c1cbe2ca61a70bb3a /lib/libc/nls/catgets.c
parent560842d4cf949f39d53e6861b2bb97cb706fe5bf (diff)
exit nicely, error out nicely
Diffstat (limited to 'lib/libc/nls/catgets.c')
-rw-r--r--lib/libc/nls/catgets.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/nls/catgets.c b/lib/libc/nls/catgets.c
index 248e6ffd4ef..1dbf56d9e47 100644
--- a/lib/libc/nls/catgets.c
+++ b/lib/libc/nls/catgets.c
@@ -1,4 +1,4 @@
-/* $NetBSD: catgets.c,v 1.8 1996/05/13 23:29:38 jtc Exp $ */
+/* $NetBSD: catgets.c,v 1.8.4.1 1996/05/28 20:06:20 jtc Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,6 +38,7 @@
#define _NLS_PRIVATE
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <nl_types.h>
@@ -54,7 +55,8 @@ _catgets(catd, set_id, msg_id, s)
struct _nls_msg_hdr *msg_hdr;
int l, u, i, r;
- if (catd == (nl_catd) 0 || catd == (nl_catd) -1) {
+ if (catd == (nl_catd) -1) {
+ errno = EBADF;
return (char *) s;
}