libcom/osi: fix dangerous usage of strncat (WIN32)
(found by sonar/cppcheck)
This commit is contained in:
@@ -64,10 +64,10 @@ epicsShareFunc int epicsShareAPI osiSockAttach()
|
||||
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
|
||||
if (titleLength) {
|
||||
titleLength = strlen (title);
|
||||
strncat (title, " " EPICS_VERSION_STRING, sizeof(title));
|
||||
strncat (title, " " EPICS_VERSION_STRING, sizeof(title)-1);
|
||||
}
|
||||
else {
|
||||
strncpy(title, EPICS_VERSION_STRING, sizeof(title));
|
||||
strncpy(title, EPICS_VERSION_STRING, sizeof(title)-1);
|
||||
}
|
||||
title[sizeof(title)-1]= '\0';
|
||||
SetConsoleTitle(title);
|
||||
|
||||
Reference in New Issue
Block a user