]> granicus.if.org Git - graphviz/commitdiff
Use _strdup instead of bad strdup on Windows
authorEmden Gansner <erg@research.att.com>
Mon, 18 Mar 2013 20:18:42 +0000 (16:18 -0400)
committerEmden Gansner <erg@research.att.com>
Mon, 18 Mar 2013 20:18:42 +0000 (16:18 -0400)
lib/gvc/gvplugin.c

index cb8e2856ea27f30595f6238cc31b0ba4b2f0ca65..817055315ef667ed477f001144321ad7ff39be20 100644 (file)
 extern int strcasecmp(const char *s1, const char *s2);
 #endif
 
+#ifdef WIN32
+#define strdup(x) _strdup(x)
+#endif
+
 /*
  * Define an apis array of name strings using an enumerated api_t as index.
  * The enumerated type is defined gvplugin.h.  The apis array is
@@ -372,11 +376,7 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str)
     }
 
     /* does str have a :path modifier? */
-#ifdef WIN32
-    s = _strdup(str);
-#else
     s = strdup(str);
-#endif
     p = strchr(s, ':');
     if (p)
        *p++ = '\0';