]> git.tdb.fi Git - libs/gl.git/commitdiff
Use sizeof when passing buffer size
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Nov 2013 15:24:49 +0000 (17:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Nov 2013 15:24:49 +0000 (17:24 +0200)
source/program.cpp

index 8b7bc6c726f49ee1fdce4f130a9e6aaa373af25e..111cf64b1d31886e3d33cf831d89c01642a18a6e 100644 (file)
@@ -110,7 +110,7 @@ void Program::link()
                int len = 0;
                int size;
                GLenum type;
-               glGetActiveUniform(id, i, 128, &len, &size, &type, name);
+               glGetActiveUniform(id, i, sizeof(name), &len, &size, &type, name);
                if(len && strncmp(name, "gl_", 3))
                {
                        /* Some implementations report the first element of a uniform array,
@@ -136,7 +136,7 @@ void Program::link()
                {
                        char name[128];
                        int len;
-                       glGetActiveUniformBlockName(id, i, 128, &len, name);
+                       glGetActiveUniformBlockName(id, i, sizeof(name), &len, name);
                        UniformBlockInfo &info = uniform_blocks[name];
                        info.name = name;