commit c3d76661cbb261590328929253a90157937e2cec
parent 0b193abe1aeeb719df717ee5955576d62f05492f
Author: hhvn <dev@hhvn.uk>
Date: Tue, 30 Nov 2021 00:29:32 +0000
nick.c: nick_dup actually copies full prefix
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/nick.c b/nick.c
@@ -155,7 +155,12 @@ nick_add(struct Nick **head, char *prefix, char priv, struct Server *server) {
struct Nick *
nick_dup(struct Nick *nick, struct Server *server) {
- return nick_create(nick->prefix, nick->priv, server);
+ /* Use strprefix to recreate the prefix.
+ * This is an example of trying to be clever
+ * backfiring - I should've just strdup'd
+ * the nick, ident and host instead of
+ * splitting prefix and pointing to it. */
+ return nick_create(nick_strprefix(nick), nick->priv, server);
}
struct Nick *