+2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * lib/groupio.c: Updated splint annotations.
+ * lib/groupio.c: Added assert to help splint.
+
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Check assumptions on snprintf().
#include "groupio.h"
static /*@null@*/struct commonio_entry *merge_group_entries (
- /*@null@*/struct commonio_entry *gr1,
+ /*@null@*/ /*@returned@*/struct commonio_entry *gr1,
/*@null@*/struct commonio_entry *gr2);
static int split_groups (unsigned int max_members);
static int group_open_hook (void);
group_close_hook
};
-static struct commonio_db group_db = {
+static /*@owned@*/struct commonio_db group_db = {
GROUP_FILE, /* filename */
&group_ops, /* ops */
NULL, /* fp */
group_db.changed = true;
}
-/*@null@*/struct commonio_entry *__gr_get_head (void)
+/*@dependent@*/ /*@null@*/struct commonio_entry *__gr_get_head (void)
{
return group_db.head;
}
-struct commonio_db *__gr_get_db (void)
+/*@observer@*/const struct commonio_db *__gr_get_db (void)
{
return &group_db;
}
if (NULL != gr2->next) {
gr2->next->prev = gr2->prev;
}
+ /* gr2 does not start with head */
+ assert (NULL != gr2->prev);
gr2->prev->next = gr2->next;
}
}
+ assert (NULL != gr1);
}
return 1;
* set).
*/
static /*@null@*/struct commonio_entry *merge_group_entries (
- /*@null@*/struct commonio_entry *gr1,
+ /*@null@*/ /*@returned@*/struct commonio_entry *gr1,
/*@null@*/struct commonio_entry *gr2)
{
struct group *gptr1;