diff --git a/src/main.c b/src/main.c index f304ad6..7107575 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2011 Pierre Pronchery */ +/* Copyright (c) 2010-2013 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Phone */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,12 +37,23 @@ #endif +/* phone */ /* private */ /* prototypes */ +static int _error(char const * message, int ret); static int _usage(void); /* functions */ +/* error */ +static int _error(char const * message, int ret) +{ + fputs("phone: ", stderr); + perror(message); + return ret; +} + + /* usage */ static int _usage(void) { @@ -65,7 +76,8 @@ int main(int argc, char * argv[]) int retry = -1; char * p; - setlocale(LC_ALL, ""); + if(setlocale(LC_ALL, "") == NULL) + _error("setlocale", 1); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); gtk_init(&argc, &argv);