aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/xtest.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-25 08:22:48 +0100
committermarha <marha@users.sourceforge.net>2011-11-25 08:22:48 +0100
commita0b4a1330be6a36ad095222d2ea83927cd33514d (patch)
tree616920ca608751e843c92c9815069f43789e3097 /xorg-server/Xext/xtest.c
parent45710577f374972946a8eb37833a9c94e5a299bf (diff)
downloadvcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.tar.gz
vcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.tar.bz2
vcxsrv-a0b4a1330be6a36ad095222d2ea83927cd33514d.zip
mesa xserver pixman git update 25 nov 2011
Diffstat (limited to 'xorg-server/Xext/xtest.c')
-rw-r--r--xorg-server/Xext/xtest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c
index 945e202d6..bd8e1d3a7 100644
--- a/xorg-server/Xext/xtest.c
+++ b/xorg-server/Xext/xtest.c
@@ -603,17 +603,16 @@ DeviceSetXTestProperty(DeviceIntPtr dev, Atom property,
* This only creates the pair, Activate/Enable Device
* still need to be called.
*/
-int AllocXTestDevice (ClientPtr client, char* name,
+int AllocXTestDevice (ClientPtr client, const char* name,
DeviceIntPtr* ptr, DeviceIntPtr* keybd,
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 ){