diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2011-07-05 20:27:11 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2011-07-05 20:27:11 -0700 |
commit | 7ad58be4808c381e900809ca6d38f7f3d8e7c904 (patch) | |
tree | 49b45e62575f8a2c42e9c1bb0fe8f97910a2587e /sesman/tools/sestest.c | |
parent | 412dab250b27b06d8e4773b44d096538a494d802 (diff) | |
download | xrdp-proprietary-7ad58be4808c381e900809ca6d38f7f3d8e7c904.tar.gz xrdp-proprietary-7ad58be4808c381e900809ca6d38f7f3d8e7c904.zip |
warnings
Diffstat (limited to 'sesman/tools/sestest.c')
-rw-r--r-- | sesman/tools/sestest.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c index 03cd1a18..4382e160 100644 --- a/sesman/tools/sestest.c +++ b/sesman/tools/sestest.c @@ -112,10 +112,16 @@ int main(int argc, char** argv) case SCP_CLIENT_STATE_RESEND_CREDENTIALS: g_printf("ERR: resend credentials - %s\n", s->errstr); g_printf(" username:"); - scanf("%255s", buf); + if (scanf("%255s", buf) < 0) + { + g_writeln("error"); + } scp_session_set_username(s, buf); g_printf(" password:"); - scanf("%255s", buf); + if (scanf("%255s", buf) < 0) + { + g_writeln("error"); + } scp_session_set_password(s, buf); e=scp_v1c_resend_credentials(c,s); break; @@ -152,11 +158,20 @@ int inputSession(struct SCP_SESSION* s) unsigned int integer; g_printf("username: "); - scanf("%255s", s->username); + if (scanf("%255s", s->username) < 0) + { + g_writeln("error"); + } g_printf("password:"); - scanf("%255s", s->password); + if (scanf("%255s", s->password) < 0) + { + g_writeln("error"); + } g_printf("hostname:"); - scanf("%255s", s->hostname); + if (scanf("%255s", s->hostname) < 0) + { + g_writeln("error"); + } g_printf("session type:\n"); g_printf("0: Xvnc\n", SCP_SESSION_TYPE_XVNC); @@ -183,17 +198,18 @@ int inputSession(struct SCP_SESSION* s) return 0; } -unsigned int menuSelect(unsigned int choices) +tui32 +menuSelect(tui32 choices) { - unsigned int sel; + tui32 sel; int ret; - ret=scanf("%u", &sel); + ret = scanf("%u", &sel); while ((ret==0) || (sel > choices)) { g_printf("invalid choice."); - scanf("%u", &sel); + ret = scanf("%u", &sel); } return sel; |