mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: unconstify string argument to add_to_string()
add_to_string() frees the original string that is passed in. This should therefore not be of "const char *" type, as the contents of the string *will* be modified (or more precisely: destroyed). Same for the congener smtk_concat_str(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
40a3e562b0
commit
643a964d09
3 changed files with 6 additions and 6 deletions
|
|
@ -211,7 +211,7 @@ static MdbTableDef *smtk_open_table(MdbHandle *mdb, char *tablename, MdbColumn
|
|||
* This is based in add_to_string() and add_to_string_va(), and, as its parents
|
||||
* frees the original string.
|
||||
*/
|
||||
static char *smtk_concat_str(const char *orig, const char *sep, const char *fmt, ...)
|
||||
static char *smtk_concat_str(char *orig, const char *sep, const char *fmt, ...)
|
||||
{
|
||||
char *str;
|
||||
va_list args;
|
||||
|
|
@ -229,7 +229,7 @@ static char *smtk_concat_str(const char *orig, const char *sep, const char *fmt,
|
|||
|
||||
free_buffer(&out);
|
||||
free_buffer(&in);
|
||||
free((void *)orig);
|
||||
free(orig);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue