From 444a5419b3f95967eeba9d93d8219bb34c74fba6 Mon Sep 17 00:00:00 2001 From: Karina Ranadive Date: Thu, 20 Jul 2023 15:11:47 -0400 Subject: [PATCH] changed var type to size_t --- common/getopt.c | 2 +- common/pam.c | 2 +- common/string_util.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/getopt.c b/common/getopt.c index e6450897..7613b69c 100644 --- a/common/getopt.c +++ b/common/getopt.c @@ -241,7 +241,7 @@ int getopt_parse(getopt_t *gopt, int argc, char *argv[], int showErrors) if (!strncmp(tok,"-",1) && strncmp(tok,"--",2)) { size_t len = strlen(tok); - int pos; + size_t pos; for (pos = 1; pos < len; pos++) { char sopt[2]; sopt[0] = tok[pos]; diff --git a/common/pam.c b/common/pam.c index 2076d396..a86b3fe2 100644 --- a/common/pam.c +++ b/common/pam.c @@ -64,7 +64,7 @@ pam_t *pam_create_from_file(const char *inpath) continue; size_t linelen = strlen(line); - for (int idx = 0; idx < linelen; idx++) { + for (size_t idx = 0; idx < linelen; idx++) { if (line[idx] == ' ') { line[idx] = 0; if (tok1) { diff --git a/common/string_util.c b/common/string_util.c index 7c64c131..4f0c9805 100644 --- a/common/string_util.c +++ b/common/string_util.c @@ -647,7 +647,7 @@ char *str_replace(const char *haystack, const char *needle, const char *replacem size_t haystack_len = strlen(haystack); size_t needle_len = strlen(needle); - int pos = 0; + size_t pos = 0; while (pos < haystack_len) { if (needle_len > 0 && str_starts_with(&haystack[pos], needle)) { string_buffer_append_string(sb, replacement);