dtgreet: Do not crash if LANG is not set in the environment.
In that case, catopen() will have never been called, and we'd feed 0 as the first argument to catgets(). This crashes, at least on OpenBSD.
This commit is contained in:
parent
0e5560cee4
commit
76c874b068
|
|
@ -791,7 +791,7 @@ unsigned char *
|
|||
ReadCatalog(int setn, int msgn, char *dflt)
|
||||
{
|
||||
OpenCatalog();
|
||||
if (0 > (int) nl_fd)
|
||||
if ((0 > (int) nl_fd) || (NULL == langenv))
|
||||
return (unsigned char*) dflt;
|
||||
else
|
||||
return (unsigned char*) catgets(nl_fd, setn, msgn, dflt);
|
||||
|
|
|
|||
Loading…
Reference in New Issue