diff --git a/src/tox-weechat-identities.c b/src/tox-weechat-identities.c index 8ee54b1..5a30d3a 100644 --- a/src/tox-weechat-identities.c +++ b/src/tox-weechat-identities.c @@ -101,7 +101,7 @@ tox_weechat_save_identity_data_file(struct t_tox_weechat_identity *identity) char *full_path = tox_weechat_identity_data_file_path(identity); char *rightmost_slash = strrchr(full_path, '/'); - char *save_dir = strndup(full_path, rightmost_slash - full_path); + char *save_dir = weechat_strndup(full_path, rightmost_slash - full_path); weechat_mkdir_parents(save_dir, 0755); free(save_dir);