X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/f4d62fc806f03876a422a1369e4ce42c1d758705..8ab2aa9fd51a89e06d92a4f7c3792aaa4a08cc71:/disobedience/login.c diff --git a/disobedience/login.c b/disobedience/login.c index a02c1c6..ae5f415 100644 --- a/disobedience/login.c +++ b/disobedience/login.c @@ -120,11 +120,13 @@ static void set_service(struct config *c, const char *s) { } static void set_username(struct config *c, const char *s) { - c->username = s; + xfree(c->username); + c->username = xstrdup(s); } static void set_password(struct config *c, const char *s) { - c->password = s; + xfree(c->password); + c->password = xstrdup(s); } /** @brief Table used to generate the form */ @@ -154,7 +156,7 @@ static void login_update_config(struct config *c) { /** @brief Save current login details */ static void login_save_config(void) { - char *path = config_userconf(0, 0), *tmp; + char *path = config_userconf(), *tmp; FILE *fp; byte_xasprintf(&tmp, "%s.tmp", path);