Fix Qgpgme build for macos
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 11 Jan 2017 14:52:44 +0000 (15:52 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 11 Jan 2017 14:52:44 +0000 (15:52 +0100)
* lang/qt/src/dn.cpp: Include string.h
(parse_dn_part): Use qstrdup.
* lang/qt/tests/t-support.h (getPassphrase): Use qstrdup.

lang/qt/src/dn.cpp
lang/qt/tests/t-support.h

index 0f81a4c..3376aef 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "dn.h"
 
+#include <strings.h>
+
 static const struct {
     const char *name;
     const char *oid;
@@ -165,7 +167,7 @@ parse_dn_part(DnPair *array, const unsigned char *string)
     for (unsigned int i = 0; i < numOidMaps; ++i)
         if (!strcasecmp((char *)p, oidmap[i].oid)) {
             free(p);
-            p = strdup(oidmap[i].name);
+            p = qstrdup(oidmap[i].name);
             break;
         }
     array->key = p;
index 704fab4..2630b7d 100644 (file)
@@ -42,7 +42,7 @@ public:
     char *getPassphrase(const char * /*useridHint*/, const char * /*description*/,
                         bool /*previousWasBad*/, bool &/*canceled*/) Q_DECL_OVERRIDE
     {
-        return strdup("abc");
+        return qstrdup("abc");
     }
 };
 } // namespace GpgME