]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - log.c
Output the period as an HTML text in the HTML reports
[thirdparty/sarg.git] / log.c
diff --git a/log.c b/log.c
index ecec946032f3f4708f01a4af6f42b404d9c0e58b..fa75c4bbda70e0cba42b10632cb683ffcac796e8 100644 (file)
--- a/log.c
+++ b/log.c
@@ -157,9 +157,18 @@ int main(int argc,char *argv[])
 #endif
 
 #if defined(ENABLE_NLS) && defined(HAVE_LOCALE_H)
-   setlocale (LC_ALL, "");
-   bindtextdomain (PACKAGE_NAME, LOCALEDIR);
-   textdomain (PACKAGE_NAME);
+   if (!setlocale (LC_ALL, "")) {
+      fprintf(stderr,"SARG: Cannot set the locale LC_ALL to the environment variable\n");
+      exit(EXIT_FAILURE);
+   }
+   if (!bindtextdomain (PACKAGE_NAME, LOCALEDIR)) {
+      fprintf(stderr,"SARG: Cannot bind to text domain %s in directory %s (%s)\n",PACKAGE_NAME,LOCALEDIR,strerror(errno));
+      exit(EXIT_FAILURE);
+   }
+   if (!textdomain (PACKAGE_NAME)) {
+      fprintf(stderr,"SARG: Cannot set gettext domain for %s PACKAGE_NAME (%s)\n",PACKAGE_NAME,strerror(errno));
+      exit(EXIT_FAILURE);
+   }
 #endif //ENABLE_NLS
 
    BgImage[0]='\0';