From b143eb371b2d88333704c626108fd4d5651092af Mon Sep 17 00:00:00 2001 From: you69man Date: Sat, 23 Dec 2023 16:16:36 +0100 Subject: [PATCH] remove strncpy warning in scheduler.h Warning was: output truncated before terminating nul copying 5 bytes from a string of the same length --- src/utils/scheduler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/scheduler.h b/src/utils/scheduler.h index 16009778..0f7cea7b 100644 --- a/src/utils/scheduler.h +++ b/src/utils/scheduler.h @@ -125,8 +125,8 @@ namespace ah { mTicker[i].timeout = timeout; mTicker[i].reload = reload; mTicker[i].isTimestamp = isTimestamp; - memset(mTicker[i].name, 0, 6); - strncpy(mTicker[i].name, name, (strlen(name) < 6) ? strlen(name) : 5); + strncpy(mTicker[i].name, name, 5); + mTicker[i].name[5]=0; if(mMax == i) mMax = i + 1; return i;