summaryrefslogtreecommitdiff
path: root/src/locale/localectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-02 14:34:55 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-02 14:39:07 +0200
commit63229aa1abdb98aa69fda9819ed2f40c8082762b (patch)
tree0f687b99e3ce562f7d1f40864d0db9496db157cc /src/locale/localectl.c
parent581fe6c8176c6ea4ad998566df0746bf7b56456f (diff)
localectl: count locale variables from 0, instead of VARIABLE_LANG
That way the we make our code safe regarding reordering of the variables in the enum.
Diffstat (limited to 'src/locale/localectl.c')
-rw-r--r--src/locale/localectl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 5917364d7c..9325d9af6d 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -114,7 +114,7 @@ static void print_overriden_variables(void) {
goto finish;
}
- for (j = VARIABLE_LANG; j < _VARIABLE_LC_MAX; j++)
+ for (j = 0; j < _VARIABLE_LC_MAX; j++)
if (variables[j]) {
if (print_warning) {
printf("Warning: Settings on Kernel Command Line override system locale settings in /etc/locale.conf\n");
@@ -126,7 +126,7 @@ static void print_overriden_variables(void) {
printf(" %s=%s\n", locale_variable_to_string(j), variables[j]);
}
finish:
- for (j = VARIABLE_LANG; j < _VARIABLE_LC_MAX; j++)
+ for (j = 0; j < _VARIABLE_LC_MAX; j++)
free(variables[j]);
}