aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/librc-strlist.c10
-rw-r--r--src/rc.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/librc-strlist.c b/src/librc-strlist.c
index 9645acb0..34f454dd 100644
--- a/src/librc-strlist.c
+++ b/src/librc-strlist.c
@@ -110,26 +110,26 @@ char *rc_strlist_addsortu (char ***list, const char *item)
}
librc_hidden_def(rc_strlist_addsortu)
-int rc_strlist_delete (char ***list, const char *item)
+bool rc_strlist_delete (char ***list, const char *item)
{
char **lst = *list;
int i = 0;
- int retval = -1;
+ bool retval = false;
if (!lst || ! item)
- return (-1);
+ return (false);
while (lst[i])
if (! strcmp (lst[i], item)) {
free (lst[i]);
- retval = 0;
+ retval = true;
do {
lst[i] = lst[i + 1];
i++;
} while (lst[i]);
}
- if (retval)
+ if (! retval)
errno = ENOENT;
return (retval);
}
diff --git a/src/rc.h b/src/rc.h
index a4d88d77..324d13fa 100644
--- a/src/rc.h
+++ b/src/rc.h
@@ -457,8 +457,8 @@ char *rc_strlist_addsortu (char ***list, const char *item);
/*! Free the item and remove it from the list. Return 0 on success otherwise -1.
* @param list to add the item too
* @param item to add.
- * @return 0 on success, otherwise -1 */
-int rc_strlist_delete (char ***list, const char *item);
+ * @return true on success, otherwise false */
+bool rc_strlist_delete (char ***list, const char *item);
/*! Moves the contents of list2 onto list1, so list2 is effectively emptied.
* Returns a pointer to the last item on the new list.
* @param list1 to append to