From: Lennart Poettering Date: Fri, 9 Jun 2023 19:57:51 +0000 (+0200) Subject: execute: fix minor type confusion X-Git-Tag: v254-rc1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcc0668282764b16bfea45292c50dce0740fb344;p=thirdparty%2Fsystemd.git execute: fix minor type confusion The .gl_pathc field is size_t, hence count in size_t too, to not accidentally drop 32 of 64bits on the floor. --- diff --git a/src/core/execute.c b/src/core/execute.c index 29e06e837e9..f9a8ae9f154 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -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);