diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-29 23:25:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-29 23:25:26 +0000 |
commit | f63f5e6489df3ccebb2c599c4f169f92b2a54b6c (patch) | |
tree | ed9cd0fc1ca4b317647963dacf09f06fdcf46949 | |
parent | 17a6c01d5839f9c235d4119bea3044d77554741d (diff) | |
download | rtmux-f63f5e6489df3ccebb2c599c4f169f92b2a54b6c.tar.gz rtmux-f63f5e6489df3ccebb2c599c4f169f92b2a54b6c.tar.bz2 rtmux-f63f5e6489df3ccebb2c599c4f169f92b2a54b6c.zip |
Clear status line on incorrect password.
-rw-r--r-- | server-fn.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/server-fn.c b/server-fn.c index 245985ce..c9355f50 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.60 2009-05-28 16:24:02 nicm Exp $ */ +/* $Id: server-fn.c,v 1.61 2009-05-29 23:25:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -212,7 +212,7 @@ server_unlock(const char *s) return (-1); out = crypt(s, server_password); if (strcmp(out, server_password) != 0) - return (-1); + goto wrong; } for (i = 0; i < ARRAY_LENGTH(&clients); i++) { @@ -223,7 +223,20 @@ server_unlock(const char *s) status_prompt_clear(c); server_redraw_client(c); } - server_locked = 0; + server_locked = 0; return (0); + +wrong: + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL) + continue; + + *c->prompt_buffer = '\0'; + c->prompt_index = 0; + server_status_client(c); + } + + return (-1); } |