summaryrefslogtreecommitdiffstats
path: root/src/rcclocale.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-12 03:55:23 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-12 03:55:23 +0000
commite598a2372179812389a702b78d5f8537eb6827d9 (patch)
treefad90d39ca5781d5ffdf4e9131050fe79d3e5383 /src/rcclocale.c
parent6b44784148735f594ac862abcd38c50c5d556df0 (diff)
downloadlibrcc-e598a2372179812389a702b78d5f8537eb6827d9.tar.gz
librcc-e598a2372179812389a702b78d5f8537eb6827d9.tar.bz2
librcc-e598a2372179812389a702b78d5f8537eb6827d9.tar.xz
librcc-e598a2372179812389a702b78d5f8537eb6827d9.zip
Language and Option Names
Diffstat (limited to 'src/rcclocale.c')
-rw-r--r--src/rcclocale.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rcclocale.c b/src/rcclocale.c
index 084efa2..3e5b56e 100644
--- a/src/rcclocale.c
+++ b/src/rcclocale.c
@@ -3,6 +3,8 @@
#include <string.h>
#include <locale.h>
+#include "../config.h"
+
#ifdef HAVE_CODESET
# include <langinfo.h>
#endif
@@ -10,6 +12,8 @@
#include "rccconfig.h"
static int rccLocaleGetClassByName(const char *locale) {
+ if (!locale) return LC_CTYPE;
+
if (!strcmp(locale, "LC_CTYPE")) return LC_CTYPE;
if (!strcmp(locale, "LC_MESSAGES")) return LC_MESSAGES;
if (!strcmp(locale, "LC_COLLATE")) return LC_COLLATE;
@@ -32,7 +36,7 @@ int rccLocaleGetLanguage(char *result, const char *lv, unsigned int n) {
int locale_class;
const char *l;
- if (!lv) return -1;
+ if ((!result)||(!n)) return -1;
locale_class = rccLocaleGetClassByName(lv);
if (locale_class >= 0) {
@@ -63,7 +67,7 @@ int rccLocaleGetCharset(char *result, const char *lv, unsigned int n) {
int locale_class;
char *l;
- if (!lv) return -1;
+ if ((!result)||(!n)) return -1;
locale_class = rccLocaleGetClassByName(lv);