From c708ac2afe2a03ed2323f3e078895fc0843c8976 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Apr 2003 18:02:27 +0000 Subject: [PATCH] fix string compare bug --- src/mesa/main/nvprogram.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c index 48b56f27e3a..fa125c40992 100644 --- a/src/mesa/main/nvprogram.c +++ b/src/mesa/main/nvprogram.c @@ -1058,7 +1058,9 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, fragProg = (struct fragment_program *) prog; for (i = 0; i < fragProg->NumParameters; i++) { - if (!_mesa_strcmp(fragProg->Parameters[i].Name, (const char *) name)) { + if (!_mesa_strncmp(fragProg->Parameters[i].Name, + (const char *) name, len) && + fragProg->Parameters[i].Name[len] == 0) { ASSERT(!fragProg->Parameters[i].Constant); fragProg->Parameters[i].Values[0] = x; fragProg->Parameters[i].Values[1] = y; @@ -1121,7 +1123,9 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, fragProg = (struct fragment_program *) prog; for (i = 0; i < fragProg->NumParameters; i++) { - if (!_mesa_strcmp(fragProg->Parameters[i].Name, (const char *) name)) { + if (!_mesa_strncmp(fragProg->Parameters[i].Name, + (const char *) name, len) && + fragProg->Parameters[i].Name[len] == 0) { ASSERT(!fragProg->Parameters[i].Constant); params[0] = fragProg->Parameters[i].Values[0]; params[1] = fragProg->Parameters[i].Values[1]; -- 2.30.2