From: Stephen Seo Date: Thu, 2 Jan 2025 04:31:52 +0000 (+0900) Subject: Fix fetching user/group UID/GID with --force-... X-Git-Tag: 1.11^2~25 X-Git-Url: https://git.seodisparate.com/stephenseo/annotated.html?a=commitdiff_plain;h=03a184a41688a1e6a13657fa0015d47a6a0ac786;p=SimpleArchiver Fix fetching user/group UID/GID with --force-... --- diff --git a/src/parser.c b/src/parser.c index e2ace59..2ed4106 100644 --- a/src/parser.c +++ b/src/parser.c @@ -431,7 +431,8 @@ int simple_archiver_parse_args(int argc, const char **argv, simple_archiver_print_usage(); return 1; } - uint32_t *uid = simple_archiver_hash_map_get(out->users_infos.UnameToUid, argv[1], strlen(argv[1])); + uint32_t *uid = simple_archiver_hash_map_get( + out->users_infos.UnameToUid, argv[1], strlen(argv[1]) + 1); if (!uid) { fprintf(stderr, "ERROR: --force-user got invalid username!\n"); simple_archiver_print_usage(); @@ -469,7 +470,8 @@ int simple_archiver_parse_args(int argc, const char **argv, simple_archiver_print_usage(); return 1; } - uint32_t *gid = simple_archiver_hash_map_get(out->users_infos.GnameToGid, argv[1], strlen(argv[1])); + uint32_t *gid = simple_archiver_hash_map_get( + out->users_infos.GnameToGid, argv[1], strlen(argv[1]) + 1); if (!gid) { fprintf(stderr, "ERROR: --force-group got invalid group!\n"); simple_archiver_print_usage();