1 Star 0 Fork 39

luofeng14/rsyslog

forked from src-openEuler/rsyslog 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-outchannel-eleminate-type-cast-for-compatibility-rea.patch 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
From d8c9771ad5d4a9ef952968a3aeadcecc2e1752a6 Mon Sep 17 00:00:00 2001
From: Dominik Andreas Schorpp <dominik.a.schorpp@vivavis.com>
Date: Mon, 2 Jan 2023 15:27:39 +0100
Subject: [PATCH] outchannel: eleminate type cast for compatibility reasons
According to the manpage the input for isspace must be of type unsigend char.
Remove all unnecessary type cast to achieve this.
Reference:https://github.com/rsyslog/rsyslog/pull/5056
Conflict:NA
Signed-off-by: Dominik Andreas Schorpp <dominik.a.schorpp@vivavis.com>
---
outchannel.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/outchannel.c b/outchannel.c
index 2f456b5..2362810 100644
--- a/outchannel.c
+++ b/outchannel.c
@@ -67,19 +67,19 @@ struct outchannel* ochConstruct(void)
/* skips the next comma and any whitespace
* in front and after it.
*/
-static void skip_Comma(char **pp)
+static void skip_Comma(uchar **pp)
{
- register char *p;
+ register uchar *p;
assert(pp != NULL);
assert(*pp != NULL);
p = *pp;
- while(isspace((int)*p))
+ while(isspace(*p))
++p;
if(*p == ',')
++p;
- while(isspace((int)*p))
+ while(isspace(*p))
++p;
*pp = p;
}
@@ -98,7 +98,7 @@ static rsRetVal get_Field(uchar **pp, uchar **pField)
assert(*pp != NULL);
assert(pField != NULL);
- skip_Comma((char**)pp);
+ skip_Comma(pp);
p = *pp;
CHKiRet(cstrConstruct(&pStrB));
@@ -135,7 +135,7 @@ static int get_off_t(uchar **pp, off_t *pOff_t)
assert(*pp != NULL);
assert(pOff_t != NULL);
- skip_Comma((char**)pp);
+ skip_Comma(pp);
p = *pp;
val = 0;
@@ -166,7 +166,7 @@ static rsRetVal get_restOfLine(uchar **pp, uchar **pBuf)
assert(*pp != NULL);
assert(pBuf != NULL);
- skip_Comma((char**)pp);
+ skip_Comma(pp);
p = *pp;
CHKiRet(cstrConstruct(&pStrB));
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luofeng14/rsyslog.git
git@gitee.com:luofeng14/rsyslog.git
luofeng14
rsyslog
rsyslog
master

搜索帮助