Fix null termination issue in previous shader version fix
This commit is contained in:
@@ -188,13 +188,11 @@ GLuint load_custom_shaders(const char* path)
|
|||||||
|
|
||||||
if (version_end != NULL)
|
if (version_end != NULL)
|
||||||
{
|
{
|
||||||
char version[30];
|
char version[30] = "";
|
||||||
|
|
||||||
size_t version_len = MIN(version_end - version_start + 1, 29);
|
size_t version_len = MIN(version_end - version_start + 1, 29);
|
||||||
|
|
||||||
memcpy(version, version_start, version_len);
|
strncat(version, version_start, version_len);
|
||||||
|
|
||||||
version[version_len] = 0; /* string null terminator */
|
|
||||||
|
|
||||||
/* replace the default version directive */
|
/* replace the default version directive */
|
||||||
vertex_sources[0] = version;
|
vertex_sources[0] = version;
|
||||||
|
Reference in New Issue
Block a user