mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
common/string-helpers.c: add strdup_printf()
This commit is contained in:
parent
41de529fff
commit
f4f35a9dff
4 changed files with 47 additions and 23 deletions
|
|
@ -16,4 +16,15 @@ char *string_strip(char *s);
|
|||
*/
|
||||
void string_truncate_at_pattern(char *buf, const char *pattern);
|
||||
|
||||
/**
|
||||
* strdup_printf - allocate and write to buffer in printf format
|
||||
* @fmt: printf-style format.
|
||||
*
|
||||
* Similar to the standard C sprintf() function but safer as it calculates the
|
||||
* maximum space required and allocates memory to hold the output.
|
||||
* The user must free the returned string.
|
||||
* Returns NULL on error.
|
||||
*/
|
||||
char *strdup_printf(const char *fmt, ...);
|
||||
|
||||
#endif /* LABWC_STRING_HELPERS_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue