aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common.h b/src/common.h
index 71d9857..e6fd453 100644
--- a/src/common.h
+++ b/src/common.h
@@ -71,7 +71,7 @@ typedef struct {
char **items;
uint32_t count;
} slapt_list_t;
-#define slapt_list_t_foreach(item, list) char *item; for (uint32_t item##_counter = 0; item = list->items[item##_counter], item##_counter < list->count; item##_counter++)
+#define slapt_list_t_foreach(item, list) char *item; for (uint32_t item##_counter = 0; (item##_counter < list->count) && (item = list->items[item##_counter]); item##_counter++)
FILE *slapt_open_file(const char *file_name, const char *mode);