From f6ee8bbf7101cee496e1684df53bfdef476316aa Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sun, 31 Dec 2023 20:31:37 +0100 Subject: [PATCH] port: net: don't die when there's a % in a chat message --- port/src/net/net.c | 2 +- port/src/net/netmsg.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/port/src/net/net.c b/port/src/net/net.c index 726d8b91b..1ee00d789 100644 --- a/port/src/net/net.c +++ b/port/src/net/net.c @@ -868,7 +868,7 @@ void netChat(const char *text) } if (g_NetMode == NETMODE_SERVER) { - sysLogPrintf(LOG_CHAT, tmp); + sysLogPrintf(LOG_CHAT, "%s", tmp); netmsgSvcChatWrite(&g_NetMsgRel, tmp); } else { netmsgClcChatWrite(&g_NetMsgRel, tmp); diff --git a/port/src/net/netmsg.c b/port/src/net/netmsg.c index 0168a19a9..42cfd155f 100644 --- a/port/src/net/netmsg.c +++ b/port/src/net/netmsg.c @@ -221,7 +221,7 @@ u32 netmsgClcChatRead(struct netbuf *src, struct netclient *srccl) char tmp[1024]; const char *msg = netbufReadStr(src); if (msg && !src->error) { - sysLogPrintf(LOG_CHAT, msg); + sysLogPrintf(LOG_CHAT, "%s", msg); netbufStartWrite(&g_NetMsgRel); netmsgSvcChatWrite(&g_NetMsgRel, msg); netSend(NULL, &g_NetMsgRel, true, NETCHAN_DEFAULT); @@ -341,7 +341,7 @@ u32 netmsgSvcChatRead(struct netbuf *src, struct netclient *srccl) char tmp[1024]; const char *msg = netbufReadStr(src); if (msg && !src->error) { - sysLogPrintf(LOG_CHAT, msg); + sysLogPrintf(LOG_CHAT, "%s", msg); } return src->error; }