diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-11 09:55:01 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-11 09:55:01 +0100 |
commit | 0eacd1852abc1b17bef29f0ba3b72bbb1b6f8a30 (patch) | |
tree | c76063c3c3658e2572fd2b617e565d10bbdf74d2 /src/basic | |
parent | 333ab199a12c7b060d3a3f4d50a8f73ee4fd5ebd (diff) | |
download | systemd-0eacd1852abc1b17bef29f0ba3b72bbb1b6f8a30.tar.gz |
basic/locale-util: reduce variable scope
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/locale-util.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index f58e0348ba..93261e675e 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -98,7 +98,6 @@ static int add_locales_from_archive(Set *locales) { _cleanup_close_ int fd = -1; size_t sz = 0; struct stat st; - size_t i; int r; fd = open("/usr/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC); @@ -129,7 +128,7 @@ static int add_locales_from_archive(Set *locales) { } e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset); - for (i = 0; i < h->namehash_size; i++) { + for (size_t i = 0; i < h->namehash_size; i++) { char *z; if (e[i].locrec_offset == 0) @@ -434,12 +433,10 @@ const char *special_glyph(SpecialGlyph code) { } void locale_variables_free(char *l[_VARIABLE_LC_MAX]) { - LocaleVariable i; - if (!l) return; - for (i = 0; i < _VARIABLE_LC_MAX; i++) + for (LocaleVariable i = 0; i < _VARIABLE_LC_MAX; i++) l[i] = mfree(l[i]); } |