If passed catgets descriptor is NULL or -1, return default string immediately

This commit is contained in:
Andrey A. Chernov 1998-04-30 12:25:05 +00:00
parent 9ad256ad65
commit e97ef24c18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35550

View File

@ -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;