[Mesa-dev] [PATCH 2/2] mesa: add spec quote explaining why value is returned

Timothy Arceri t_arceri at yahoo.com.au
Thu Sep 5 02:57:42 PDT 2013


Add this comment because other places in OpenGL include the NULL terminator in the length.

Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
 src/mesa/main/objectlabel.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
index 7e39c92..0942f72 100644
--- a/src/mesa/main/objectlabel.c
+++ b/src/mesa/main/objectlabel.c
@@ -92,6 +92,11 @@ copy_label(char **labelPtr, char *label, int *length, int bufSize)
 {
    int labelLen = 0;
 
+   /* The KHR_debug spec says:
+    *
+    * "The actual number of characters written into <label>,
+    * excluding the null terminator, is returned in <length>."
+    */
    if (*labelPtr)
       labelLen = strlen(*labelPtr);
 
-- 
1.7.9.5



More information about the mesa-dev mailing list