about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--command.c6
-rw-r--r--input_win.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/command.c b/command.c
index dce3ad5c..84ac8ad5 100644
--- a/command.c
+++ b/command.c
@@ -30,8 +30,8 @@ int handle_start_command(char *inp)
     }
     
     // trim input and take a copy
-    char inp_cpy[100];
     inp = trim(inp);
+    char inp_cpy[strlen(inp) + 1];
     strcpy(inp_cpy, inp);
     
     // get the command "/command"
@@ -70,8 +70,8 @@ int handle_command(char *inp)
     if (inp[0] == '/') {
 
         // trim input and take a copy
-        char inp_cpy[100];
         inp = trim(inp);
+        char inp_cpy[strlen(inp) + 1];
         strcpy(inp_cpy, inp);
 
         // get the command "/command"
@@ -131,7 +131,7 @@ static int _cmd_start_connect(char *inp)
 
         status_bar_get_password();
         status_bar_refresh();
-        char passwd[20];
+        char passwd[21];
         inp_get_password(passwd);
         int connect_status = jabber_connect(user, passwd);
         if (connect_status == CONNECTING)
diff --git a/input_win.c b/input_win.c
index 8adce620..cd911c9f 100644
--- a/input_win.c
+++ b/input_win.c
@@ -84,7 +84,7 @@ void inp_get_password(char *passwd)
 {
     wclear(inp_win);
     noecho();
-    mvwgetstr(inp_win, 0, 1, passwd);
+    mvwgetnstr(inp_win, 0, 1, passwd, 20);
     wmove(inp_win, 0, 1);
     echo();
     status_bar_clear();