]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: fix minor type confusion
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Jun 2023 19:57:51 +0000 (21:57 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 10 Jun 2023 06:12:40 +0000 (15:12 +0900)
The .gl_pathc field is size_t, hence count in size_t too, to not
accidentally drop 32 of 64bits on the floor.

src/core/execute.c

index 29e06e837e9a51963dbb986e1293dd5e137a16a0..f9a8ae9f154abce6f83a9a2cb7bac6142babce04 100644 (file)
@@ -2867,7 +2867,7 @@ static int load_credential_glob(
                 if (r < 0)
                         return r;
 
-                for (unsigned n = 0; n < pglob.gl_pathc; n++) {
+                for (size_t n = 0; n < pglob.gl_pathc; n++) {
                         _cleanup_free_ char *fn = NULL;
                         _cleanup_(erase_and_freep) char *data = NULL;
                         size_t size;
@@ -6253,7 +6253,7 @@ static int exec_context_load_environment(const Unit *unit, const ExecContext *c,
                 /* When we don't match anything, -ENOENT should be returned */
                 assert(pglob.gl_pathc > 0);
 
-                for (unsigned n = 0; n < pglob.gl_pathc; n++) {
+                for (size_t n = 0; n < pglob.gl_pathc; n++) {
                         _cleanup_strv_free_ char **p = NULL;
 
                         r = load_env_file(NULL, pglob.gl_pathv[n], &p);