Convert glx/single2.c:DoGetString() to use asprintf()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
f3cb512dc4
commit
71a89d9733
|
@ -351,12 +351,10 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
|
||||||
}
|
}
|
||||||
else if ( name == GL_VERSION ) {
|
else if ( name == GL_VERSION ) {
|
||||||
if ( atof( string ) > atof( GLServerVersion ) ) {
|
if ( atof( string ) > atof( GLServerVersion ) ) {
|
||||||
buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 );
|
if ( asprintf( &buf, "%s (%s)", GLServerVersion, string ) == -1) {
|
||||||
if ( buf == NULL ) {
|
|
||||||
string = GLServerVersion;
|
string = GLServerVersion;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf( buf, "%s (%s)", GLServerVersion, string );
|
|
||||||
string = buf;
|
string = buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue