summaryrefslogtreecommitdiff
path: root/xs.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-03-09 08:58:43 +0100
committerdefault <nobody@localhost>2024-03-09 08:58:43 +0100
commit951e6b23151d298d9babeec81bc9926c11bdb3b3 (patch)
treef68cc7334f91f7ac8cfa3068798c28e97540952f /xs.h
parent91bb0615d982d1adcc5680c346f9510905464584 (diff)
Replaced all xs_dict_iter() with xs_dict_next().
Diffstat (limited to 'xs.h')
-rw-r--r--xs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/xs.h b/xs.h
index afd8245..85464db 100644
--- a/xs.h
+++ b/xs.h
@@ -1028,6 +1028,9 @@ int xs_dict_iter(xs_dict **dict, xs_str **key, xs_val **value)
int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt)
/* iterates a dict, with context */
{
+ if (xs_type(dict) != XSTYPE_DICT)
+ return 0;
+
int goon = 1;
char *p = (char *)dict;