commit 7d65200a86d59344554941d39370be8d8a887a44 parent ee88d856bf5415f281e7f36b4ff324fe542f7ffc Author: Michael Savage <mikejsavage@gmail.com> Date: Tue Sep 6 13:17:30 -0700 Intel debug messages don't include trailing newlines Diffstat:
gl.cc | | | 9 | +++++++-- |
diff --git a/gl.cc b/gl.cc @@ -50,11 +50,16 @@ static void gl_error_printer( const GLenum source, const GLenum type, const GLuint id, const GLenum severity, const GLsizei length, const GLchar * const message, const void * _ ) { - // %.*s because we don't want the trailing \n + // we don't want the trailing \n + size_t len = strlen( message ); + if( len > 0 && message[ len - 1 ] == '\n' ) { + len--; + } + WARN( "GL [%s - %s]: %.*s", type_string( type ), severity_string( severity ), - strlen( message ) - 1, message ); + len, message ); if( severity == GL_DEBUG_SEVERITY_HIGH ) { exit( 1 );