progs/glsl: Prevent possible string overflow.
[mesa.git] / progs / glsl / texdemo1.c
index 5b1913a722ba5a5dbe2e5637e781261f7c74de3d..2076e6aef94508ea214f16cc5406a5b0dccf7ea1 100644 (file)
@@ -400,11 +400,8 @@ InitPrograms(void)
 static void
 Init(GLboolean useImageFiles)
 {
-   const char *version = (const char *) glGetString(GL_VERSION);
-
-   if (version[0] != '2' || version[1] != '.') {
-      printf("Warning: this program expects OpenGL 2.0\n");
-      /*exit(1);*/
+   if (!ShadersSupported()) {
+      exit(1);
    }
    printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));