Merge branch 'jc/submodule-helper-avoid-zu' into jch

An accidental use of the '%zu' format specifier in 'git
submodule--helper' has been corrected to use 'PRIuMAX' and cast the
value to 'uintmax_t' to avoid portability issues.

* jc/submodule-helper-avoid-zu:
  submodule--helper: avoid use of %zu for now
jch
Junio C Hamano 2026-07-25 14:27:08 -07:00
commit b9fde7e366
1 changed files with 2 additions and 1 deletions

View File

@ -549,7 +549,8 @@ static void create_default_gitdir_config(const char *submodule_name)
}

/* Case 2.4: If all the above failed, try a hash of the name as a last resort */
header_len = snprintf(header, sizeof(header), "blob %zu", strlen(submodule_name));
header_len = snprintf(header, sizeof(header),
"blob %"PRIuMAX, (uintmax_t)strlen(submodule_name));
git_hash_init(&ctx, the_hash_algo);
git_hash_update(&ctx, header, header_len);
git_hash_update(&ctx, "\0", 1);