diff options
| author | default <nobody@localhost> | 2022-12-08 07:08:53 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2022-12-08 07:08:53 +0100 |
| commit | 8222776ff9212f0f1bdb559fd277d0e13d68afd4 (patch) | |
| tree | 768274e75f0d5ee02542a4325dcf0103904bb2ed /html.c | |
| parent | 7565b8f39701aaa53b4868ad9c17d0a6fb63c4d2 (diff) | |
Little tweak to previous change to avoid a memleak.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -367,7 +367,13 @@ d_char *build_mentions(snac *snac, char *msg) if (type && strcmp(type, "Mention") == 0 && href && strcmp(href, snac->actor) != 0 && name) { - if (name[0] != '@') name = xs_str_cat(xs_str_new("@"), name); + xs *s1 = NULL; + + if (name[0] != '@') { + s1 = xs_fmt("@%s", name); + name = s1; + } + xs *l = xs_split(name, "@"); /* is it a name without a host? */ |