diff options
Diffstat (limited to 'src/glxinfo.c')
-rw-r--r-- | src/glxinfo.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/glxinfo.c b/src/glxinfo.c index c6d89e3..0378bda 100644 --- a/src/glxinfo.c +++ b/src/glxinfo.c @@ -49,6 +49,7 @@ format_extension_list(const char *ext) { int i; char * extTmp = NULL; /* Actual string to print */ + const char *extCountTmp; if ( !ext || !ext[0] ) @@ -56,19 +57,19 @@ format_extension_list(const char *ext) /* Count number of extensions (to get number of commas needed) */ i = 0; - extTmp = (char *)ext; - while ( *extTmp != '\0' ) { - if ( *extTmp == ' ' ) { + extCountTmp = ext; + while ( *extCountTmp != '\0' ) { + if ( *extCountTmp == ' ' ) { i++; } - extTmp++; + extCountTmp++; } /* * Allocate buffer that will hold the extension string with * commas in it */ - extTmp = (char *) malloc( (strlen(ext) +i +1) *sizeof(char) ); + extTmp = malloc( (strlen(ext) +i +1) *sizeof(char) ); if ( extTmp == NULL ) { return NULL; } |