mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: remove add_to_string() function
Last user removed in 160f06db8d
.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6252d22adf
commit
6c7942ac1c
2 changed files with 0 additions and 29 deletions
|
@ -258,30 +258,3 @@ void put_quoted(struct membuffer *b, const char *text, int is_attribute, int is_
|
|||
text = p;
|
||||
}
|
||||
}
|
||||
|
||||
char *add_to_string_va(char *old, const char *fmt, va_list args)
|
||||
{
|
||||
char *res;
|
||||
membuffer o, n;
|
||||
put_vformat(&n, fmt, args);
|
||||
put_format(&o, "%s\n%s", old ?: "", mb_cstring(&n));
|
||||
res = strdup(mb_cstring(&o));
|
||||
free((void *)old);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* this is a convenience function that cleverly adds text to a string, using our membuffer
|
||||
* infrastructure.
|
||||
* WARNING - this will free(old), the intended pattern is
|
||||
* string = add_to_string(string, fmt, ...)
|
||||
*/
|
||||
char *add_to_string(char *old, const char *fmt, ...)
|
||||
{
|
||||
char *res;
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
res = add_to_string_va(old, fmt, args);
|
||||
va_end(args);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue