From 12ae4dfcc1bafe0346d270fdddd4af907b663347 Mon Sep 17 00:00:00 2001 From: Roberto Sassu Date: Fri, 26 Jun 2020 15:14:38 +0200 Subject: [PATCH] Replace atoi() with strtol() --- generators/compact.c | 2 +- generators/unknown.c | 2 +- src/gen_digest_lists.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/compact.c b/generators/compact.c index a087da2..dc7e4d1 100644 --- a/generators/compact.c +++ b/generators/compact.c @@ -392,7 +392,7 @@ int generator(int dirfd, int pos, struct list_head *head_in, continue; if (path_list_ext) { - st.st_mode = atoi(cur->attrs[1]); + st.st_mode = strtol(cur->attrs[1], NULL, 10); st.st_uid = 0; pwd = getpwnam(cur->attrs[2]); if (pwd) diff --git a/generators/unknown.c b/generators/unknown.c index aed7c48..03d71f8 100644 --- a/generators/unknown.c +++ b/generators/unknown.c @@ -397,7 +397,7 @@ int generator(int dirfd, int pos, struct list_head *head_in, continue; if (path_list_ext) { - st.st_mode = atoi(cur->attrs[1]); + st.st_mode = strtol(cur->attrs[1], NULL, 10); st.st_uid = 0; pwd = getpwnam(cur->attrs[2]); if (pwd) diff --git a/src/gen_digest_lists.c b/src/gen_digest_lists.c index 333d655..0847cbc 100644 --- a/src/gen_digest_lists.c +++ b/src/gen_digest_lists.c @@ -215,7 +215,7 @@ int main(int argc, char **argv) } break; case 'p': - pos = atoi(optarg); + pos = strtol(optarg, NULL, 10); break; case 't': for (i = 0; i < COMPACT__LAST; i++) -- GitLab