Skip to content

Commit b283e16

Browse files
committed
Fixed some errors with StaticGlShaders::QueryGlslVersion and walked through it carefully with a debugger/
1 parent 55ba31f commit b283e16

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libprojectM/Renderer/StaticGlShaders.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ StaticGlShaders::GlslVersion StaticGlShaders::QueryGlslVersion() {
799799
/* scan the anything before the number */
800800
while (position<version_len) {
801801
char ch = cstr[position];
802-
if ((ch >= '0') || (ch <= '9')) {
802+
if ((ch >= '0') && (ch <= '9')) {
803803
break;
804804
}
805805
position++;
@@ -810,14 +810,15 @@ StaticGlShaders::GlslVersion StaticGlShaders::QueryGlslVersion() {
810810
int possible_major = 0;
811811
while (position<version_len) {
812812
char ch = cstr[position];
813-
if ((ch >= '0') || (ch <= '9')) {
813+
if ((ch >= '0') && (ch <= '9')) {
814814
possible_major = (possible_major * 10) + ch - '0';
815815
}
816816
else if (ch == '.') { /* got the minor */
817-
position++;
818817
int possible_minor = 0;
818+
position++;
819819
while (position<version_len) {
820-
if ((ch >= '0') || (ch <= '9')) {
820+
ch = cstr[position];
821+
if ((ch >= '0') && (ch <= '9')) {
821822
possible_minor = (possible_minor * 10) + ch - '0';
822823
}
823824
else break;

0 commit comments

Comments
 (0)