69 lines
2.6 KiB
Diff
69 lines
2.6 KiB
Diff
From 0c547ede4927a01e11c115062d9f314cd66d7ce2 Mon Sep 17 00:00:00 2001
|
|
From: zhongtao <zhongtao17@huawei.com>
|
|
Date: Thu, 30 May 2024 21:30:43 +1400
|
|
Subject: [PATCH 222/226] code improve
|
|
|
|
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
|
---
|
|
src/cmd/isula/volume/prune.c | 2 +-
|
|
src/cmd/options/opt_log.c | 2 +-
|
|
src/daemon/executor/container_cb/execution_information.c | 2 +-
|
|
src/daemon/modules/image/oci/registry_type.c | 2 +-
|
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/cmd/isula/volume/prune.c b/src/cmd/isula/volume/prune.c
|
|
index c8d632ed..3b5bfbf1 100644
|
|
--- a/src/cmd/isula/volume/prune.c
|
|
+++ b/src/cmd/isula/volume/prune.c
|
|
@@ -79,7 +79,7 @@ out:
|
|
|
|
int cmd_volume_prune_main(int argc, const char **argv)
|
|
{
|
|
- int i = 0;
|
|
+ size_t i = 0;
|
|
struct isula_libutils_log_config lconf = { 0 };
|
|
int exit_code = 1;
|
|
command_t cmd;
|
|
diff --git a/src/cmd/options/opt_log.c b/src/cmd/options/opt_log.c
|
|
index b1abcfaf..8ffb9966 100644
|
|
--- a/src/cmd/options/opt_log.c
|
|
+++ b/src/cmd/options/opt_log.c
|
|
@@ -67,7 +67,7 @@ static int log_opt_syslog_facility(const char *key, const char *value, char **pa
|
|
"authpriv", "ftp", "local0", "local1", "local2",
|
|
"local3", "local4", "local5", "local6", "local7"
|
|
};
|
|
- int i;
|
|
+ size_t i;
|
|
size_t f_len = sizeof(facility_values) / sizeof(const char *);
|
|
|
|
for (i = 0; i < f_len; i++) {
|
|
diff --git a/src/daemon/executor/container_cb/execution_information.c b/src/daemon/executor/container_cb/execution_information.c
|
|
index 6489797d..217741fa 100644
|
|
--- a/src/daemon/executor/container_cb/execution_information.c
|
|
+++ b/src/daemon/executor/container_cb/execution_information.c
|
|
@@ -249,7 +249,7 @@ static int get_proxy_env(char **proxy, const char *type)
|
|
}
|
|
*col_pos = '\0';
|
|
nret = snprintf(*proxy, proxy_len, "%s:%s%s", tmp_proxy, mask_str, at_pos);
|
|
- if (nret < 0 || nret >= proxy_len) {
|
|
+ if (nret < 0 || (size_t)nret >= proxy_len) {
|
|
ret = -1;
|
|
free(*proxy);
|
|
*proxy = NULL;
|
|
diff --git a/src/daemon/modules/image/oci/registry_type.c b/src/daemon/modules/image/oci/registry_type.c
|
|
index 4556617f..206c58b0 100644
|
|
--- a/src/daemon/modules/image/oci/registry_type.c
|
|
+++ b/src/daemon/modules/image/oci/registry_type.c
|
|
@@ -62,7 +62,7 @@ void free_layer_blob(layer_blob *layer)
|
|
|
|
void free_pull_desc(pull_descriptor *desc)
|
|
{
|
|
- int i = 0;
|
|
+ size_t i = 0;
|
|
|
|
if (desc == NULL) {
|
|
return;
|
|
--
|
|
2.33.0
|
|
|