TD-1244
This commit is contained in:
parent
bafad31882
commit
227e8f37ab
|
@ -39,6 +39,7 @@
|
||||||
#include <Winsock2.h>
|
#include <Winsock2.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <conio.h>
|
||||||
#include "msvcProcess.h"
|
#include "msvcProcess.h"
|
||||||
#include "msvcDirect.h"
|
#include "msvcDirect.h"
|
||||||
#include "msvcFcntl.h"
|
#include "msvcFcntl.h"
|
||||||
|
|
|
@ -58,11 +58,20 @@ char *strsep(char **stringp, const char *delim) {
|
||||||
|
|
||||||
char *getpass(const char *prefix) {
|
char *getpass(const char *prefix) {
|
||||||
static char passwd[TSDB_KEY_LEN] = {0};
|
static char passwd[TSDB_KEY_LEN] = {0};
|
||||||
|
memset(passwd, 0, TSDB_KEY_LEN);
|
||||||
printf("%s", prefix);
|
printf("%s", prefix);
|
||||||
scanf("%s", passwd);
|
|
||||||
|
|
||||||
char n = getchar();
|
int32_t index = 0;
|
||||||
|
char ch;
|
||||||
|
while (index < TSDB_KEY_LEN) {
|
||||||
|
ch = getch();
|
||||||
|
if (ch == '\n' || ch == '\r') {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
passwd[index++] = ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return passwd;
|
return passwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue