timerd.cpp: fix Wstringop-truncation

Signed-off-by: Markus Volk <f_l_k@t-online.de>
This commit is contained in:
Markus Volk
2020-01-30 22:29:54 +01:00
parent 1189b484ea
commit b6975e8b0a

View File

@@ -129,12 +129,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));
}
}
}