X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/43e9ac12ea9282621bfaed783cb4c96847e9406b..c28b7e03130c89fae7bad65806977cdbccb79c53:/src/xbt/dict_cursor.c diff --git a/src/xbt/dict_cursor.c b/src/xbt/dict_cursor.c index 1110af7516..de99ef2881 100644 --- a/src/xbt/dict_cursor.c +++ b/src/xbt/dict_cursor.c @@ -58,7 +58,7 @@ void xbt_dict_cursor_free(xbt_dict_cursor_t *cursor) { /* * Sanity check to see if the head contains something */ -static _XBT_INLINE void __cursor_not_null(xbt_dict_cursor_t cursor) { +static XBT_INLINE void __cursor_not_null(xbt_dict_cursor_t cursor) { xbt_assert0(cursor, "Null cursor"); } @@ -103,11 +103,16 @@ void xbt_dict_cursor_first(const xbt_dict_t dict, * \brief Move to the next element. */ void xbt_dict_cursor_step(xbt_dict_cursor_t cursor) { + + + xbt_dictelm_t current ; + int line; + DEBUG0("xbt_dict_cursor_step"); xbt_assert(cursor); - xbt_dictelm_t current = cursor->current; - int line = cursor->line; + current = cursor->current; + line = cursor->line; if (cursor->dict != NULL) { @@ -137,10 +142,12 @@ void xbt_dict_cursor_step(xbt_dict_cursor_t cursor) { int xbt_dict_cursor_get_or_free(xbt_dict_cursor_t *cursor, char **key, void **data) { - DEBUG0("xbt_dict_get_or_free"); xbt_dictelm_t current; + DEBUG0("xbt_dict_get_or_free"); + + if (!cursor || !(*cursor)) return FALSE;