Report errors from setlocale(3)

This commit is contained in:
Pierre Pronchery 2015-10-01 21:32:57 +02:00
parent 01b09b39ab
commit a5bda368db

View File

@ -45,6 +45,8 @@
/* private */
/* prototypes */
static int _panelctl(PanelMessageShow what, gboolean show);
static int _error(char const * message, int ret);
static int _usage(void);
@ -57,6 +59,15 @@ static int _panelctl(PanelMessageShow what, gboolean show)
}
/* error */
static int _error(char const * message, int ret)
{
fputs(PROGNAME ": ", stderr);
perror(message);
return ret;
}
/* usage */
static int _usage(void)
{
@ -83,7 +94,8 @@ int main(int argc, char * argv[])
int what = -1;
gboolean show = TRUE;
setlocale(LC_ALL, "");
if(setlocale(LC_ALL, "") == NULL)
_error("setlocale", 1);
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
gtk_init(&argc, &argv);