Fixed captive_strdup_alloca() to return the copy, not the original string
authorshort <>
Thu, 3 Apr 2003 12:20:17 +0000 (12:20 +0000)
committershort <>
Thu, 3 Apr 2003 12:20:17 +0000 (12:20 +0000)
src/libcaptive/include/captive/macros.h

index f30843e..8292a8f 100644 (file)
@@ -294,9 +294,9 @@ gsize r;
  */
 #define captive_strdup_alloca(string) ({ \
                const gchar *_captive_strdup_alloca_string=(string); \
-               gchar *_captive_strdup_alloca_r=g_alloca(strlen(_captive_strdup_alloca_string)+1); \
-               strcpy(_captive_strdup_alloca_r,_captive_strdup_alloca_string); \
-               (const gchar *)(_captive_strdup_alloca_string); \
+               const gchar *_captive_strdup_alloca_r=g_alloca(strlen(_captive_strdup_alloca_string)+1); \
+               strcpy((gchar *)_captive_strdup_alloca_r,_captive_strdup_alloca_string); \
+               (const gchar *)(_captive_strdup_alloca_r); \
                })