From eae06108b5fe86dffab7c13e7baaffcfa770e8f3 Mon Sep 17 00:00:00 2001 From: mquinson Date: Wed, 28 Jan 2004 23:56:32 +0000 Subject: [PATCH] Set the cursor to NULL before use in an iteration git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@19 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/dict.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dict.h b/include/dict.h index f6e70b0a68..1719cc9b1b 100644 --- a/include/dict.h +++ b/include/dict.h @@ -139,8 +139,8 @@ void gras_dict_cursor_step (gras_dict_cursor_t *cursor); int gras_dict_cursor_get_or_free (gras_dict_cursor_t **cursor, char **key, void **data); -#define gras_dict_foreach(dict,cursor,key,data) \ - for (gras_dict_cursor_first((dict),&(cursor)) ; \ +#define gras_dict_foreach(dict,cursor,key,data) \ + for (cursor=NULL, gras_dict_cursor_first((dict),&(cursor)) ; \ gras_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data)); \ gras_dict_cursor_step(cursor) ) -- 2.20.1