diff options
author | Brian Paul <[email protected]> | 2003-04-08 18:02:27 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-04-08 18:02:27 +0000 |
commit | c708ac2afe2a03ed2323f3e078895fc0843c8976 (patch) | |
tree | 4670c1a23e52d1f78baa023c068474b774840e92 /src/mesa | |
parent | 38c619bf15609037e89d9b6377fe1d033d707ff1 (diff) |
fix string compare bug
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/nvprogram.c | 8 |
1 files 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]; |