about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-28 19:50:16 +0000
committerJames Booth <boothj5@gmail.com>2015-01-28 19:50:16 +0000
commitec28888915132f03a4ecad45987a0b94c17f2e01 (patch)
tree65edca4c5f1161133b6e9c6b6039c7d2286b20a6 /src
parent6529220351dd9b11c610df1c3372dd138d2af2b4 (diff)
downloadprofani-tty-ec28888915132f03a4ecad45987a0b94c17f2e01.tar.gz
Strip only trailing newline from eval_password
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 60ef3780..25314c2e 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -154,7 +154,10 @@ cmd_connect(gchar **args, struct cmd_help_t help)
                         cons_show("Error evaluating password, see logs for details.");
                         return TRUE;
                     }
-                    g_strstrip(account->password);
+                    // strip trailing newline
+                    if (g_str_has_suffix(account->password, "\n")) {
+                        account->password[strlen(account->password)-1] = '\0';
+                    }
                 } else {
                     log_error("popen failed when running eval_password.");
                     cons_show("Error evaluating password, see logs for details.");