aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2020-08-07 22:25:34 -0400
committerJason Woodward2020-08-07 22:25:34 -0400
commitd900fc969a06e8b702d6cf2fa9d196e7c46c35f8 (patch)
tree5d6219940e855d5d868c559ab98e609c84bef09e
parenteb1fc38a5a64aafc6402546f383929b88101a3d7 (diff)
downloadslapt-get-d900fc969a06e8b702d6cf2fa9d196e7c46c35f8.tar.gz
common: check for initialized in slapt_vector_t_foreach
-rw-r--r--src/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common.h b/src/common.h
index 03d39f0..97ff3dd 100644
--- a/src/common.h
+++ b/src/common.h
@@ -86,7 +86,7 @@ int slapt_vector_t_index_of(slapt_vector_t *, slapt_vector_t_cmp, void *);
slapt_vector_t *slapt_vector_t_search(slapt_vector_t *, slapt_vector_t_cmp, void *);
#define slapt_vector_t_foreach(type, item, list) \
type item; \
- for (uint32_t item##_counter = 0; (item##_counter < list->size) && (item = list->items[item##_counter]); item##_counter++)
+ if (list) for (uint32_t item##__counter__ = 0; (item##__counter__ < list->size) && (item = list->items[item##__counter__]); item##__counter__++)
FILE *slapt_open_file(const char *file_name, const char *mode);
slapt_regex_t *slapt_regex_t_init(const char *regex_string);