summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-01-31 20:25:27 (GMT)
committer Simon <simon@hardwired.org.uk>2011-01-31 20:25:27 (GMT)
commit5ec884993f62a37ded46ff1008c31dc8e0b4e8f4 (patch)
tree23317a70e132f0f93891594fa82bee83be2b80db /src/interface.c
parent76e2193318744fe27d04f940c7ead35d341f641a (diff)
downloadpowder-5ec884993f62a37ded46ff1008c31dc8e0b4e8f4.zip
powder-5ec884993f62a37ded46ff1008c31dc8e0b4e8f4.tar.gz
Fix login for non-elevated users
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index 7661ae1..43c66e8 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -867,11 +867,19 @@ void login_ui(pixel *vid_buf)
if (res && !strncmp(res, "OK ", 3))
{
char *s_id,*u_e,*nres;
+ printf("\n{%s}\n", res);
s_id = strchr(res+3, ' ');
+ if (!s_id)
+ goto fail;
*(s_id++) = 0;
u_e = strchr(s_id, ' ');
- *(u_e++) = 0;
+ if (!u_e){
+ u_e = malloc(1);
+ memset(u_e, 0, 1);
+ }
+ else
+ *(u_e++) = 0;
strcpy(svf_user_id, res+3);
strcpy(svf_session_id, s_id);