+ } + + if (label) { + /* set new label string */ + + if (length >= 0) { + /* explicit length */ + *labelPtr = (char *) malloc(length); + if (*labelPtr) { + memcpy(*labelPtr, label, length); + }The length given by the client is not required to include a terminating null-character.
Ok I see what you mean now. Fixed in V3 of the patch I just sent out.
+ } + else { + /* null-terminated string */ + int len = strlen(label); + if (len >= MAX_LABEL_LENGTH) { + /* An INVALID_VALUE error is generated if the number of characters + * in <label>, excluding the null terminator when <length> is + * negative, is not less than the value of MAX_LABEL_LENGTH. + */ + _mesa_error(ctx, GL_INVALID_VALUE, + "%s(length=%d, which is not less than " + "GL_MAX_LABEL_LENGTH=%d)", caller, length, + MAX_LABEL_LENGTH);This error should also be generated when the client specifies an explicit length that exceeds MAX_LABEL_LENGTH.
Yes you are right. The wording in the spec was confusing me a little I had to read it a couple of times before it made sense. Again fixed in V3 of the patch I just sent out.
Fredrik
Thanks for reviewing Fredrik Tim _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
