summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c
index 112fef4..1c2c59a 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -867,18 +867,26 @@ 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);
nres = mystrdup(u_e);
-
+
printf("\n{%s} {%s} {%s}\n", svf_user_id, svf_session_id, nres);
-
+
if (!strncmp(nres, "ADMIN", 5))
{
svf_admin = 1;
@@ -3854,7 +3862,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show
mx /= sdl_scale;
my /= sdl_scale;
ed.focus = 1;
-
+
clearrect(vid_buf, 0, 0, XRES+BARSIZE, 220);//anyway to make it transparent?
draw_line(vid_buf, 1, 219, XRES, 219, 228, 228, 228, XRES+BARSIZE);
drawtext(vid_buf, 100, 15, "Welcome to The Powder Toy console v.2 (by cracker64)\n"