diff -r 1aecddf7e209 -r 5c9ec5a0a4ef src/cx/string.h --- a/src/cx/string.h Thu Dec 05 01:54:12 2024 +0100 +++ b/src/cx/string.h Sat Dec 07 23:59:54 2024 +0100 @@ -313,7 +313,11 @@ * If \p str already contains a string, the memory will be reallocated and * the other strings are appended. Otherwise, new memory is allocated. * - * \note It is guaranteed that there is only one allocation. + * If memory allocation fails, the pointer in the returned string will + * be \c NULL. Depending on the allocator, \c errno might be set. + * + * \note It is guaranteed that there is only one allocation for the + * resulting string. * It is also guaranteed that the returned string is zero-terminated. * * @param alloc the allocator to use @@ -337,7 +341,11 @@ * The resulting string will be allocated by the specified allocator. * So developers \em must pass the return value to cx_strfree_a() eventually. * - * \note It is guaranteed that there is only one allocation. +* If memory allocation fails, the pointer in the returned string will + * be \c NULL. Depending on the allocator, \c errno might be set. + * + * \note It is guaranteed that there is only one allocation for the + * resulting string. * It is also guaranteed that the returned string is zero-terminated. * * @param alloc the allocator to use @@ -354,7 +362,11 @@ * The resulting string will be allocated by standard \c malloc(). * So developers \em must pass the return value to cx_strfree() eventually. * - * \note It is guaranteed that there is only one allocation. +* If memory allocation fails, the pointer in the returned string will + * be \c NULL and \c errno might be set. + * + * \note It is guaranteed that there is only one allocation for the + * resulting string. * It is also guaranteed that the returned string is zero-terminated. * * @param count the number of the other following strings to concatenate @@ -373,7 +385,11 @@ * If \p str already contains a string, the memory will be reallocated and * the other strings are appended. Otherwise, new memory is allocated. * - * \note It is guaranteed that there is only one allocation. +* If memory allocation fails, the pointer in the returned string will + * be \c NULL and \c errno might be set. + * + * \note It is guaranteed that there is only one allocation for the + * resulting string. * It is also guaranteed that the returned string is zero-terminated. * * @param str the string the other strings shall be concatenated to