代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/sysSentry 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6e98b2e5008ffabfda8d1c10778717f972b54398 Mon Sep 17 00:00:00 2001
From: jwolf <523083921@qq.com>
Date: Mon, 22 Jul 2024 14:58:27 +0800
Subject: [PATCH] cpu_utility and cpu_patrol musht be an integer
---
src/c/catcli/catlib/cli_param_checker.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/c/catcli/catlib/cli_param_checker.c b/src/c/catcli/catlib/cli_param_checker.c
index a1aa636..e400428 100644
--- a/src/c/catcli/catlib/cli_param_checker.c
+++ b/src/c/catcli/catlib/cli_param_checker.c
@@ -2,6 +2,7 @@
#include <sys/un.h>
#include <regex.h>
#include <stdbool.h>
+#include <string.h>
#include <limits.h>
#include <unistd.h>
#include "cli_common.h"
@@ -13,7 +14,7 @@
void checkset_cpu_usage_percentage(char *getopt_optarg, catcli_request_body *p_request_body, struct option_errs *errs)
{
long cpu_utility = strtol(getopt_optarg, NULL, DECIMAL);
- if (cpu_utility <= 0 || cpu_utility > CPU_USAGE_PERCENTAGE_MAX) {
+ if (cpu_utility <= 0 || cpu_utility > CPU_USAGE_PERCENTAGE_MAX || strchr(getopt_optarg, '.') != NULL) {
strncpy(errs->patrol_module_err,
"\"cpu_utility \" must be an integer greater in the range (0,100],correct \"-u, --cpu_utility\"\n", MAX_ERR_LEN);
}
@@ -68,7 +69,7 @@ void checkset_cpulist(char *getopt_optarg, catcli_request_body *p_request_body,
void checkset_patrol_time(char *getopt_optarg, catcli_request_body *p_request_body, struct option_errs *errs)
{
long second = strtol(getopt_optarg, NULL, DECIMAL);
- if (second <= 0 || second > INT_MAX) {
+ if (second <= 0 || second > INT_MAX || strchr(getopt_optarg, '.') != NULL) {
strncpy(errs->patrol_time_err,
"\"patrol_second\" must be a number in the range of (0,INT_MAX] ,correct \"-t, --patrol_second\"\n",
MAX_ERR_LEN);
--
Gitee
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。