From 18b65ec90969f6807a143c24603fbef4bce61e9e Mon Sep 17 00:00:00 2001 From: morganamilo Date: Sat, 3 Feb 2024 16:42:21 +0000 Subject: [PATCH] pacman: remove uses of atoi --- src/pacman/pacman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index e5c6e420..26ae520a 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -381,7 +381,7 @@ static int parsearg_global(int opt) break; case OP_ASK: config->noask = 1; - config->ask = (unsigned int)atoi(optarg); + config->ask = (unsigned int)strtol(optarg, NULL, 10); break; case OP_CACHEDIR: config->cachedirs = alpm_list_add(config->cachedirs, strdup(optarg)); @@ -409,7 +409,7 @@ static int parsearg_global(int opt) * here, error and warning are set in config_new, though perhaps a * --quiet option will remove these later */ if(optarg) { - unsigned short debug = (unsigned short)atoi(optarg); + int debug = strtol(optarg, NULL, 10); switch(debug) { case 2: config->logmask |= ALPM_LOG_FUNCTION;