timerd.cpp: fix Wstringop-truncation

Signed-off-by: Markus Volk <f_l_k@t-online.de>


Origin commit data
------------------
Commit: 25c3ca83a7
Author: Markus Volk <f_l_k@t-online.de>
Date: 2020-01-30 (Thu, 30 Jan 2020)
This commit is contained in:
Markus Volk
2020-01-30 22:29:54 +01:00
committed by vanhofen
parent fc5e5bf4a4
commit 165b204a06

View File

@@ -130,12 +130,12 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
else if(event->eventType == CTimerd::TIMER_REMIND)
{
memset(resp.message, 0, sizeof(resp.message));
strncpy(resp.message, static_cast<CTimerEvent_Remind*>(event)->message, sizeof(resp.message)-1);
strncpy(resp.message, static_cast<CTimerEvent_Remind*>(event)->message, sizeof(resp.message));
}
else if (event->eventType == CTimerd::TIMER_EXEC_PLUGIN)
{
memset(resp.pluginName, 0, sizeof(resp.pluginName));
strncpy(resp.pluginName, static_cast<CTimerEvent_ExecPlugin*>(event)->name, sizeof(resp.message)-1);
strncpy(resp.pluginName, static_cast<CTimerEvent_ExecPlugin*>(event)->name, sizeof(resp.pluginName));
}
}
}