diff options
| author | 2022-12-08 07:08:53 +0100 | |
|---|---|---|
| committer | 2022-12-08 07:08:53 +0100 | |
| commit | 8222776ff9212f0f1bdb559fd277d0e13d68afd4 (patch) | |
| tree | 768274e75f0d5ee02542a4325dcf0103904bb2ed | |
| parent | Merge pull request 'Fix mentions with one @ sign' (#16) from kensanata/snac2:... (diff) | |
| download | snac2-8222776ff9212f0f1bdb559fd277d0e13d68afd4.tar.gz snac2-8222776ff9212f0f1bdb559fd277d0e13d68afd4.tar.xz snac2-8222776ff9212f0f1bdb559fd277d0e13d68afd4.zip | |
Little tweak to previous change to avoid a memleak.
| -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) | |||
| 367 | 367 | ||
| 368 | if (type && strcmp(type, "Mention") == 0 && | 368 | if (type && strcmp(type, "Mention") == 0 && |
| 369 | href && strcmp(href, snac->actor) != 0 && name) { | 369 | href && strcmp(href, snac->actor) != 0 && name) { |
| 370 | if (name[0] != '@') name = xs_str_cat(xs_str_new("@"), name); | 370 | xs *s1 = NULL; |
| 371 | |||
| 372 | if (name[0] != '@') { | ||
| 373 | s1 = xs_fmt("@%s", name); | ||
| 374 | name = s1; | ||
| 375 | } | ||
| 376 | |||
| 371 | xs *l = xs_split(name, "@"); | 377 | xs *l = xs_split(name, "@"); |
| 372 | 378 | ||
| 373 | /* is it a name without a host? */ | 379 | /* is it a name without a host? */ |