diff --git a/auto/src/glew_gl.c b/auto/src/glew_gl.c index 4c956f9..e429c49 100644 --- a/auto/src/glew_gl.c +++ b/auto/src/glew_gl.c @@ -62,13 +62,13 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) s = glGetString(GL_VERSION); if (!s) return GLEW_ERROR_NO_GL_VERSION; i = _glewStrCLen(s, '.')+1; - if (s+i == NULL || s[i] < '1') + if (s+i-1 == NULL || s+i == NULL || s[i] < '1') { return GLEW_ERROR_GL_VERSION_10_ONLY; } else { - if (s[3] >= '5') + if (s[i] >= '5') { GLEW_VERSION_1_1 = GL_TRUE; GLEW_VERSION_1_2 = GL_TRUE; @@ -76,7 +76,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) GLEW_VERSION_1_4 = GL_TRUE; GLEW_VERSION_1_5 = GL_TRUE; } - if (s[2] == '4') + if (s[i] == '4') { GLEW_VERSION_1_1 = GL_TRUE; GLEW_VERSION_1_2 = GL_TRUE; @@ -84,7 +84,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) GLEW_VERSION_1_4 = GL_TRUE; GLEW_VERSION_1_5 = GL_FALSE; } - if (s[2] == '3') + if (s[i] == '3') { GLEW_VERSION_1_1 = GL_TRUE; GLEW_VERSION_1_2 = GL_TRUE; @@ -92,7 +92,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) GLEW_VERSION_1_4 = GL_FALSE; GLEW_VERSION_1_5 = GL_FALSE; } - if (s[2] == '2') + if (s[i] == '2') { GLEW_VERSION_1_1 = GL_TRUE; GLEW_VERSION_1_2 = GL_TRUE; @@ -100,7 +100,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) GLEW_VERSION_1_4 = GL_FALSE; GLEW_VERSION_1_5 = GL_FALSE; } - if (s[2] < '2') + if (s[i] < '2') { GLEW_VERSION_1_1 = GL_TRUE; GLEW_VERSION_1_2 = GL_FALSE;