Bug 11588

Summary: glGetShaderiv returns lenghts without null
Product: Mesa Reporter: Jan Dvorak <jan.dvorak>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: low    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: glgetshader/glgetprogram patch

Description Jan Dvorak 2007-07-13 12:11:53 UTC
The glGetShaderiv function returns lengths (GL_INFO_LOG_LENGTH and GL_SHADER_SOURCE_LENGTH) without including the null terminating character (the spec says it should include it)
Comment 1 Brian Paul 2007-07-13 12:55:12 UTC
The functions that implement those queries are in src/mesa/shader/shader_api.c.  Maybe you could try fixing things and submitting a patch?
Comment 2 Jan Dvorak 2007-07-13 13:24:57 UTC
Created attachment 10714 [details] [review]
glgetshader/glgetprogram patch

I wasn't sure if it isn't deliberate :) Anyway, here's patch
Comment 3 Brian Paul 2007-07-13 13:38:03 UTC
Thanks.  That looks good, but there's also a length returned by the glGetInfoLogARB() function.  So you might check/test the _mesa_get_shader/program_info_log() functions to see if they're correct or off by one.
Comment 4 Jan Dvorak 2007-07-13 14:42:46 UTC
(In reply to comment #3)
> Thanks.  That looks good, but there's also a length returned by the
> glGetInfoLogARB() function.  So you might check/test the
> _mesa_get_shader/program_info_log() functions to see if they're correct or off
> by one.
> 
They're returning number of characters written into buffer, excluding the terminator, so yes, they are correct.
Comment 5 Brian Paul 2007-07-13 15:37:29 UTC
Fixed in git.  Thanks!
Comment 6 Adam Jackson 2009-08-24 12:27:19 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.