]> granicus.if.org Git - shadow/commitdiff
* libmisc/list.c: Added assertions for non NULL parameters.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 31 Aug 2008 17:30:21 +0000 (17:30 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 31 Aug 2008 17:30:21 +0000 (17:30 +0000)
ChangeLog
libmisc/list.c

index d19cc289e2f58f874f380111bd065cc4a6896ec9..1adfc147f11d36d69ce1090b4713bea5cad2a8ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-08-29  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/list.c: Remove historical comment.
 2008-08-29  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/list.c: Remove historical comment.
+       * libmisc/list.c: Added assertions for non NULL parameters.
 
 2008-08-29  Nicolas François  <nicolas.francois@centraliens.net>
 
 
 2008-08-29  Nicolas François  <nicolas.francois@centraliens.net>
 
index ee4796a7780755e763019da50d94372d645ca829..1b243912b8ce1becfa5729807cc5503c8071180b 100644 (file)
@@ -49,6 +49,7 @@ char **add_list (char **list, const char *member)
        char **tmp;
 
        assert (NULL != member);
        char **tmp;
 
        assert (NULL != member);
+       assert (NULL != list);
 
        /*
         * Scan the list for the new name.  Return the original list
 
        /*
         * Scan the list for the new name.  Return the original list
@@ -98,6 +99,7 @@ char **del_list (char **list, const char *member)
        char **tmp;
 
        assert (NULL != member);
        char **tmp;
 
        assert (NULL != member);
+       assert (NULL != list);
 
        /*
         * Scan the list for the old name.  Return the original list
 
        /*
         * Scan the list for the old name.  Return the original list
@@ -144,6 +146,8 @@ char **dup_list (char *const *list)
        int i;
        char **tmp;
 
        int i;
        char **tmp;
 
+       assert (NULL != list);
+
        for (i = 0; NULL != list[i]; i++);
 
        tmp = (char **) xmalloc ((i + 1) * sizeof (char *));
        for (i = 0; NULL != list[i]; i++);
 
        tmp = (char **) xmalloc ((i + 1) * sizeof (char *));
@@ -162,6 +166,7 @@ char **dup_list (char *const *list)
 bool is_on_list (char *const *list, const char *member)
 {
        assert (NULL != member);
 bool is_on_list (char *const *list, const char *member)
 {
        assert (NULL != member);
+       assert (NULL != list);
 
        while (NULL != *list) {
                if (strcmp (*list, member) == 0) {
 
        while (NULL != *list) {
                if (strcmp (*list, member) == 0) {