Fix snprintf warning;

There's a potential string truncation here if you have a uniform array with a really long name.
This commit is contained in:
bjorn 2019-03-16 19:43:04 -07:00
parent 7441456aab
commit 9744d95039
1 changed files with 2 additions and 2 deletions

View File

@ -1830,8 +1830,8 @@ static void lovrShaderSetupUniforms(Shader* shader) {
int location = uniform.location;
if (uniform.count > 1) {
char name[LOVR_MAX_UNIFORM_LENGTH];
snprintf(name, LOVR_MAX_UNIFORM_LENGTH, "%s[%d]", uniform.name, j);
char name[76 /* LOVR_MAX_UNIFORM_LENGTH + 2 + 10 */];
snprintf(name, sizeof(name), "%s[%d]", uniform.name, j);
location = glGetUniformLocation(program, name);
}