chiark / gitweb /
lib/configuration.c, etc.: Remove arguments from `config_userconf'.
[disorder] / disobedience / login.c
index a02c1c6e698188013c2a5e80051a5083ab8d92ed..ae5f415f43273ed6e5b82beb0cd3a19a1f991f0e 100644 (file)
@@ -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);