Commit c9a499c9c9b8aec88c8ba1a1f58fb86c3bb15d5d

Ran Benita 2018-08-24T09:14:14

darray: fix unprotected macro argument Reported-by: @msmeissn Signed-off-by: Ran Benita <ran234@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/darray.h b/src/darray.h
index c30fd7d..8e87c94 100644
--- a/src/darray.h
+++ b/src/darray.h
@@ -104,7 +104,7 @@ typedef darray (unsigned long)  darray_ulong;
 #define darray_from_items(arr, items, count) do { \
     unsigned __count = (count); \
     darray_resize(arr, __count); \
-    if (count != 0) \
+    if (__count != 0) \
         memcpy((arr).item, items, __count * sizeof(*(arr).item)); \
 } while (0)