Mercurial > trustbridge
diff common/strhelp.h @ 319:4077eff1dd39
Added terminateing version of asprintf.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 04 Apr 2014 17:58:14 +0200 |
parents | c596568fa45b |
children | 17e1c8f37d72 |
line wrap: on
line diff
--- a/common/strhelp.h Fri Apr 04 17:13:35 2014 +0200 +++ b/common/strhelp.h Fri Apr 04 17:58:14 2014 +0200 @@ -23,6 +23,15 @@ void xfree ( void *p ); /** + * @brief Terminating variant of asprintf + * + * This function behaves exactly like asprintf(3) but will terminate + * when an error occures (usally that means that memoy allocation + * failed). + */ +int xasprintf (char **strp, const char *fmt, ...); + +/** * @brief Returns the length of the given %NULL-terminated * string array str_array. * @param[in] str_array a %NULL-terminated array of strings