Set errno for expand function of the string list.

This commit is contained in:
Andreas Schneider 2008-09-02 11:23:38 +02:00
parent b629730fb0
commit 8753352e5e
2 changed files with 3 additions and 1 deletions

View file

@ -100,6 +100,7 @@ int c_strlist_add(c_strlist_t *strlist, const char *string) {
} }
strlist->count++; strlist->count++;
} else { } else {
errno = ENOBUFS;
return -1; return -1;
} }

View file

@ -92,7 +92,8 @@ c_strlist_t *c_strlist_expand(c_strlist_t *strlist, size_t size);
* @param strlist Stringlist to add the string. * @param strlist Stringlist to add the string.
* @param string String to add. * @param string String to add.
* *
* @return 0 on success, less than 0 if an error occured. * @return 0 on success, less than 0 and errno set if an error occured.
* ENOBUFS if the list is full.
*/ */
int c_strlist_add(c_strlist_t *strlist, const char *string); int c_strlist_add(c_strlist_t *strlist, const char *string);