Skip to content

Commit

Permalink
execute: fix minor type confusion
Browse files Browse the repository at this point in the history
The .gl_pathc field is size_t, hence count in size_t too, to not
accidentally drop 32 of 64bits on the floor.
  • Loading branch information
poettering authored and yuwata committed Jun 10, 2023
1 parent 4fd7c71 commit fcc0668
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fcc0668

Please sign in to comment.