mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 12:49:21 +00:00
Convert AllocXTestDevice to use asprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
@@ -608,12 +608,11 @@ int AllocXTestDevice (ClientPtr client, char* name,
|
||||
DeviceIntPtr master_ptr, DeviceIntPtr master_keybd)
|
||||
{
|
||||
int retval;
|
||||
int len = strlen(name);
|
||||
char *xtestname = calloc(len + 7, 1 );
|
||||
char *xtestname;
|
||||
char dummy = 1;
|
||||
|
||||
strncpy( xtestname, name, len);
|
||||
strncat( xtestname, " XTEST", 6 );
|
||||
if (asprintf(&xtestname, "%s XTEST", name) == -1)
|
||||
return BadAlloc;
|
||||
|
||||
retval = AllocDevicePair( client, xtestname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE);
|
||||
if ( retval == Success ){
|
||||
|
||||
Reference in New Issue
Block a user