]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] Improve documentation of cookie code.
[wget] / src / wget.h
index ea8d69778cc618deac69a7bcc0f26561cf5d1d9a..4dfe86bd7d6fd15a27da1ebc69597a0db60ab7dc 100644 (file)
@@ -185,18 +185,13 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
 
    int a[5] = {1, 2};           -- countof(a) == 5
 
-   char *a[3] = {               -- countof(a) == 3
+   char *a[] = {                -- countof(a) == 3
      "foo", "bar", "baz"
-   };
-
-   And, most importantly, it works when the compiler counts the array
-   elements for you:
-
-   char *a[] = {                -- countof(a) == 4
-     "foo", "bar", "baz", "qux"
-   }  */
+   }; */
 #define countof(array) (sizeof (array) / sizeof (*(array)))
 
+#define alloca_array(type, size) ((type *) alloca ((size) * sizeof (type)))
+
 /* Copy the data delimited with BEG and END to alloca-allocated
    storage, and zero-terminate it.  Arguments are evaluated only once,
    in the order BEG, END, PLACE.  */
@@ -232,7 +227,7 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
 
 #define STRDUP_ALLOCA(ptr, str) do {           \
   (ptr) = (char *)alloca (strlen (str) + 1);   \
-  strcpy (ptr, str);                           \
+  strcpy ((ptr), (str));                       \
 } while (0)
 
 /* Generally useful if you want to avoid arbitrary size limits but