diff options
author | ache <ache@FreeBSD.org> | 1998-04-30 12:25:05 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-04-30 12:25:05 +0000 |
commit | b2b5a3545a3c7cc842f4c5a9586682571ee2e423 (patch) | |
tree | 0be5602bd67cd9e383a9307a8ae97af8959c4dd9 /lib | |
parent | c21e828637035b02c47764b7cedfeef3e145db96 (diff) | |
download | FreeBSD-src-b2b5a3545a3c7cc842f4c5a9586682571ee2e423.zip FreeBSD-src-b2b5a3545a3c7cc842f4c5a9586682571ee2e423.tar.gz |
If passed catgets descriptor is NULL or -1, return default string immediately
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/nls/msgcat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index df8977d..8f53e30 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -1,4 +1,4 @@ -/* $Id: msgcat.c,v 1.14 1998/04/30 11:06:12 ache Exp $ */ +/* $Id: msgcat.c,v 1.15 1998/04/30 11:39:08 ache Exp $ */ /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. @@ -257,6 +257,8 @@ __const char *dflt; MCCatT *cat = (MCCatT *) catd; __const char *cptr; + if (catd == NULL || catd == NLERR) + return((char *)dflt); msg = MCGetMsg(MCGetSet(cat, setId), msgId); if (msg) cptr = msg->msg.str; else cptr = dflt; |