aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorm MacDownlad <megazig@megazig-desktop.(none)>2009-10-19 12:39:52 -0500
committerNorm MacDownlad <megazig@megazig-desktop.(none)>2009-10-19 12:39:52 -0500
commit56c06a7eba37d9634d89964d45bb7bd55eb901b2 (patch)
tree99d2096c56b429d72703b416aaf580f92e564503
parent65210f63c38a0c35b2e9dd52be79ad330d816e67 (diff)
added check for texture/material range to stop a strcmp bug
-rw-r--r--brlyt.c10
-rw-r--r--general.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/brlyt.c b/brlyt.c
index 2d777e5..386c5bc 100644
--- a/brlyt.c
+++ b/brlyt.c
@@ -410,6 +410,11 @@ u16 findMatOffset(char *mats)
isEqual = strcmp(mats, mat);
if (isEqual != 0) i++;
mat = mat + strlen(mat) + 1;
+ if( i == numberOfMaterials )
+ {
+ printf("ERROR: material not found: %s\n", mats);
+ exit(-1);
+ }
}
return i;
}
@@ -424,6 +429,11 @@ u16 findTexOffset(char *tex)
isEqual = strcmp(tex, texs);
if (isEqual != 0) i++;
texs = texs + strlen(texs) + 1;
+ if( i == numberOfTextures )
+ {
+ printf("ERROR: texture not found: %s\n", tex);
+ exit(-1);
+ }
}
return i;
}
diff --git a/general.h b/general.h
index f066010..5ca7b05 100644
--- a/general.h
+++ b/general.h
@@ -12,7 +12,7 @@
#define BENZIN_VERSION_MAJOR 1
#define BENZIN_VERSION_MINOR 9
-#define BENZIN_VERSION_BUILD 7
+#define BENZIN_VERSION_BUILD 8
#define BENZIN_VERSION_OTHER "BETA"
#define INFORMATION_TEXT \