PDA

View Full Version : GL_EXTENSIONS



Syslock
11-24-2001, 07:54 AM
Is it dangerous to use strtok directly on the string returned
by GL_EXTENSIONS?

CHAR separators[] = " \t\n";
CHAR *char_buffer = glGetString(GL_EXTENSIONS);
strtok( char_buffer, separators );

Humus
11-24-2001, 01:34 PM
Usually no, but I personally don't like the strtok function because it copies the string to a static buffer somewhere. How big this buffer is though is undocumented (at least in VC++) and probably implementation specific (unless the ANSI standard says something about that). I personally would have liked the function to return a start and end pointer instead.