Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/xorg-server.old/dist/Xext use asprintf() to a...
details: https://anonhg.NetBSD.org/xsrc/rev/f5207352cf92
branches: trunk
changeset: 10409:f5207352cf92
user: christos <christos%NetBSD.org@localhost>
date: Mon Oct 28 03:20:13 2019 +0000
description:
use asprintf() to avoid strncpy warning (as the newer version does)
diffstat:
external/mit/xorg-server.old/dist/Xext/xtest.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diffs (19 lines):
diff -r 4c9d0efc80dd -r f5207352cf92 external/mit/xorg-server.old/dist/Xext/xtest.c
--- a/external/mit/xorg-server.old/dist/Xext/xtest.c Sun Oct 27 17:38:08 2019 +0000
+++ b/external/mit/xorg-server.old/dist/Xext/xtest.c Mon Oct 28 03:20:13 2019 +0000
@@ -611,12 +611,11 @@
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 ){
Home |
Main Index |
Thread Index |
Old Index