wcmValidateDevice.c: In function 'wcmOptionDupConvert':
wcmValidateDevice.c:319:2: warning: 'Xprintf' is deprecated (declared at
/opt/xorg/include/xorg/os.h:271)
wcmValidateDevice.c: In function 'wcmDuplicateAttributes':
wcmValidateDevice.c:362:2: warning: 'Xprintf' is deprecated (declared at
/opt/xorg/include/xorg/os.h:271)
wcmConfig.c: In function 'wcmPreInit':
wcmConfig.c:515:3: warning: 'Xprintf' is deprecated (declared at
/opt/xorg/include/xorg/os.h:271)

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/wcmConfig.c         |    4 +++-
 src/wcmValidateDevice.c |   10 ++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 2694306..1b93f08 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -512,7 +512,9 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
        {
                /* we need subdevices, change the name so all of them have a
                   type. */
-               char *new_name = Xprintf("%s %s", pInfo->name, type);
+               char *new_name;
+               if (asprintf(&new_name, "%s %s", pInfo->name, type) == -1)
+                       new_name = strdup(pInfo->name);
                pInfo->name = priv->name = new_name;
        }
 
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index fd424dc..a22ca3c 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -303,6 +303,7 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, 
const char* basename
        InputOption *iopts = NULL, *new;
        char *name;
        pointer options;
+       int rc;
 
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
        options = xf86OptionListDuplicate(original);
@@ -316,7 +317,9 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, 
const char* basename
        }
 #endif
 
-       name = Xprintf("%s %s", basename, type);
+       rc = asprintf(&name, "%s %s", basename, type);
+       if (rc == -1) /* if asprintf fails, strdup will probably too... */
+               name = strdup("unknown");
 
        options = xf86ReplaceStrOption(options, "Type", type);
        options = xf86ReplaceStrOption(options, "Name", name);
@@ -357,9 +360,12 @@ static void wcmFreeInputOpts(InputOption* opts)
 static InputAttributes* wcmDuplicateAttributes(InputInfoPtr pInfo,
                                               const char *type)
 {
+       int rc;
        InputAttributes *attr;
        attr = DuplicateInputAttributes(pInfo->attrs);
-       attr->product = Xprintf("%s %s", attr->product, type);
+       rc = asprintf(&attr->product, "%s %s", attr->product, type);
+       if (rc == -1)
+               attr->product = NULL;
        return attr;
 }
 #endif
-- 
1.7.3.3

Cheers,
  Peter

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to