Re: [AD] SF.net SVN: alleg:[13158] allegro/branches/4.9/src/opengl/extensions.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 30 Mar 2010, at 14:46 , mmimica@xxxxxxxxxx wrote:
> +   for (major = 9; major > 0; major--) {
> +      for (minor1 = 9; minor1 >= 0; minor1--) {
> +         for (minor2 = 9; minor2 >= 0; minor2--) {
> +            sprintf(ver, "%i.%i.%i", major, minor1, minor2);
> +            if (strncmp(str, ver, 5) == 0) {

Yuck.
What's wrong with sscanf()?
Say,
major = minor1 = minor2 = 0;
sscanf(ver, "%d.%d.%d", &major, &minor1, &minor2);
?

I don't know the answer to this question, but can OpenGL version numbers have more than one digit, or do they guarantee that that never happens?

Evert



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/