Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
input chineses verify code for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
GangZhuo committed Oct 20, 2016
1 parent f832553 commit 7512228
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,21 @@ static PcsBool verifycode(unsigned char *ptr, size_t size, char *captcha, size_t
fclose(pf);

printf("The captcha image at %s.\nPlease input the captcha code: ", savedfile);
#ifdef WIN32
{
char fmt[32];
memset(captcha, 0, captchaSize);
snprintf(fmt, sizeof(fmt), "%%%ds", captchaSize - 1);
scanf(fmt, captcha);
}
if (!u8_is_utf8_sys()) {
char *u8s = mbs2utf8(captcha);
strncpy(captcha, u8s, captchaSize);
pcs_free(u8s);
}
#else
std_string(captcha, captchaSize);
#endif
return PcsTrue;
}

Expand Down

0 comments on commit 7512228

Please sign in to comment.