Lian Li Uni Hub: Leave room in the char array for the null character

This commit is contained in:
Moshe Schmidt 2022-12-23 17:45:41 +00:00 committed by Adam Honse
parent ac2af0c788
commit 26dfceaf6d
2 changed files with 2 additions and 2 deletions

View file

@ -647,7 +647,7 @@ std::string LianLiUniHubController::ReadVersion()
/*-------------------------------------*\
| Format version string |
\*-------------------------------------*/
char version[14];
char version[15];
int vlength = std::snprintf(version, sizeof(version), "%x.%x.%x.%x.%x", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4]);
return(std::string(version, vlength));

View file

@ -735,7 +735,7 @@ std::string LianLiUniHub_AL10Controller::ReadVersion()
/*-------------------------------------*\
| Format version string |
\*-------------------------------------*/
char version[14];
char version[15];
int vlength = std::snprintf(version, sizeof(version), "%x.%x.%x.%x.%x", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4]);
return(std::string(version, vlength));