forked from speed-dreams/speed-dreams-code
fix overlapping copy found by address sanitizer
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7022 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 182fb464826a442d0b9febf885262b91db27765b Former-commit-id: 997133ef9e46e552783d7d70aac6a6efa7a46d09
This commit is contained in:
parent
38785391eb
commit
72cd04351c
1 changed files with 5 additions and 2 deletions
|
@ -242,8 +242,11 @@ void* GetFileHandle(const char* RobotName)
|
|||
{
|
||||
void* RobotSettings = NULL;
|
||||
|
||||
if (BufName != RobotName) // Don't copy if same names
|
||||
{
|
||||
strncpy(BufName, RobotName, BUFSIZE - 1); // Save robot's name
|
||||
BufName[BUFSIZE - 1] = '\0';
|
||||
}
|
||||
snprintf(BufPathDirRel, BUFSIZE, // Robot's directory
|
||||
"drivers/%s",RobotName); // relative to installation
|
||||
snprintf(BufPathXMLRel, BUFSIZE, // Robot's xml-filename
|
||||
|
|
Loading…
Reference in a new issue