1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 10:26:37 +02:00

update DHTnodes, small fixes

This commit is contained in:
Jfreegman
2014-09-17 13:52:27 -04:00
parent 913ec7b3fe
commit a1015a366a
2 changed files with 8 additions and 12 deletions

View File

@ -492,10 +492,7 @@ static int password_prompt(char *buf, int size)
/* re-enable terminal echo */
tcsetattr(fileno(stdin), TCSANOW, &oflags);
if (p == NULL)
return 0;
if (len <= 1)
if (p == NULL || len <= 1)
return 0;
/* eat overflowed stdin and return error */
@ -510,7 +507,7 @@ static int password_prompt(char *buf, int size)
return len;
}
/* Ask user if they would like to encrypt the data file on first usage */
/* Ask user if they would like to encrypt the data file and set password */
static void first_time_encrypt(const char *msg)
{
char ch[256] = {0};
@ -519,9 +516,8 @@ static void first_time_encrypt(const char *msg)
system("clear");
printf("%s ", msg);
if (!strcasecmp(ch, "y\n") || !strcasecmp(ch, "n\n")
|| !strcasecmp(ch, "yes\n") || !strcasecmp(ch, "no\n")
|| !strcasecmp(ch, "q\n"))
if (!strcasecmp(ch, "y\n") || !strcasecmp(ch, "n\n") || !strcasecmp(ch, "yes\n")
|| !strcasecmp(ch, "no\n") || !strcasecmp(ch, "q\n"))
break;
} while (fgets(ch, sizeof(ch), stdin));