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