Checking errors when setting the locale
This commit is contained in:
parent
f26f0aeb29
commit
511aded638
17
src/main.c
17
src/main.c
|
@ -43,7 +43,21 @@
|
||||||
|
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
|
/* prototypes */
|
||||||
|
static int _error(char const * message, int ret);
|
||||||
|
static int _usage(void);
|
||||||
|
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
/* error */
|
||||||
|
static int _error(char const * message, int ret)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: ", PROGNAME);
|
||||||
|
perror(message);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* usage */
|
/* usage */
|
||||||
static int _usage(void)
|
static int _usage(void)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +78,8 @@ int main(int argc, char * argv[])
|
||||||
PanelPrefs prefs;
|
PanelPrefs prefs;
|
||||||
char * p;
|
char * p;
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
if(setlocale(LC_ALL, "") == NULL)
|
||||||
|
_error("setlocale", 1);
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
gtk_init(&argc, &argv);
|
gtk_init(&argc, &argv);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user