summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-04-08 18:02:27 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-04-08 18:02:27 +0000
commitc708ac2afe2a03ed2323f3e078895fc0843c8976 (patch)
tree4670c1a23e52d1f78baa023c068474b774840e92
parent38c619bf15609037e89d9b6377fe1d033d707ff1 (diff)
fix string compare bug
-rw-r--r--src/mesa/main/nvprogram.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index 48b56f27e3..fa125c4099 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];