diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-10-31 21:36:47 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-23 12:15:06 -0800 |
commit | 71a89d97332cc181becc5a5f73166e642f96c076 (patch) | |
tree | 9684263dc2592fddb7f36490d645e24273379bde /glx | |
parent | f3cb512dc4daaeed389bb4740e21b6e2330e01e1 (diff) |
Convert glx/single2.c:DoGetString() to use asprintf()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/single2.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/glx/single2.c b/glx/single2.c index 9884f400f..9f8254b01 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -351,12 +351,10 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) } else if ( name == GL_VERSION ) { if ( atof( string ) > atof( GLServerVersion ) ) { - buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 ); - if ( buf == NULL ) { + if ( asprintf( &buf, "%s (%s)", GLServerVersion, string ) == -1) { string = GLServerVersion; } else { - sprintf( buf, "%s (%s)", GLServerVersion, string ); string = buf; } } |