Is it dangerous to use strtok directly on the string returned
by GL_EXTENSIONS?
CHAR separators[] = "
";
CHAR *char_buffer = glGetString(GL_EXTENSIONS);
strtok( char_buffer, separators );
Is it dangerous to use strtok directly on the string returned
by GL_EXTENSIONS?
CHAR separators[] = "
";
CHAR *char_buffer = glGetString(GL_EXTENSIONS);
strtok( char_buffer, separators );
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.