diff options
author | James Booth <boothj5@gmail.com> | 2013-11-07 22:15:43 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-11-07 22:15:43 +0000 |
commit | 99d3322834c337bd6de755665acc08472769b5bd (patch) | |
tree | 59a68e30159eaea454320360c466e064a1a25e6f | |
parent | 1248f49cfaf9806dfcf40e0d0f6fe854d693d6a3 (diff) | |
download | profani-tty-99d3322834c337bd6de755665acc08472769b5bd.tar.gz |
Added MAX_PASSWORD_SIZE set to 64
fixes #245
-rw-r--r-- | src/command/command.c | 2 | ||||
-rw-r--r-- | src/config/accounts.h | 2 | ||||
-rw-r--r-- | src/ui/inputwin.c | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/command/command.c b/src/command/command.c index 35bcd4f7..296cf38d 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -3530,7 +3530,7 @@ _cmd_xa(gchar **args, struct cmd_help_t help) static char * _ask_password(void) { - char *passwd = malloc(sizeof(char) * 21); + char *passwd = malloc(sizeof(char) * (MAX_PASSWORD_SIZE + 1)); status_bar_get_password(); status_bar_refresh(); inp_block(); diff --git a/src/config/accounts.h b/src/config/accounts.h index ba282eac..f28067f1 100644 --- a/src/config/accounts.h +++ b/src/config/accounts.h @@ -23,6 +23,8 @@ #ifndef ACCOUNTS_H #define ACCOUNTS_H +#define MAX_PASSWORD_SIZE 64 + #include "common.h" typedef struct prof_account_t { diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index dfcb533d..d5b882d7 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -35,6 +35,7 @@ #include "command/command.h" #include "common.h" +#include "config/accounts.h" #include "config/preferences.h" #include "config/theme.h" #include "log.h" @@ -207,7 +208,7 @@ inp_get_password(char *passwd) _clear_input(); _inp_win_refresh(); noecho(); - mvwgetnstr(inp_win, 0, 1, passwd, 20); + mvwgetnstr(inp_win, 0, 1, passwd, MAX_PASSWORD_SIZE); wmove(inp_win, 0, 0); echo(); status_bar_clear(); |