Merge pull request #860 from En-En-Code/oglgetdriverversion-fix
fix: null-terminate versionSubstring in OGLGetDriverVersion
This commit is contained in:
commit
f51e19b19b
|
@ -733,7 +733,8 @@ static void OGLGetDriverVersion(const char *oglVersionString,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the version substring and parse it.
|
// Copy the version substring and parse it.
|
||||||
char *versionSubstring = (char *)malloc(versionStringLength * sizeof(char));
|
char *versionSubstring = (char *)malloc((versionStringLength + 1) * sizeof(char));
|
||||||
|
versionSubstring[versionStringLength] = '\0';
|
||||||
strncpy(versionSubstring, versionStrStart, versionStringLength);
|
strncpy(versionSubstring, versionStrStart, versionStringLength);
|
||||||
|
|
||||||
unsigned int major = 0;
|
unsigned int major = 0;
|
||||||
|
|
Loading…
Reference in New Issue