mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 01:06:44 +02:00
add missing malloc error checks and fix widechar to char comparison
This commit is contained in:
@ -429,12 +429,17 @@ static int password_prompt(char *buf, int size)
|
||||
}
|
||||
|
||||
const char *p = fgets(buf, size, stdin);
|
||||
int len = strlen(buf);
|
||||
|
||||
/* re-enable terminal echo */
|
||||
tcsetattr(fileno(stdin), TCSANOW, &oflags);
|
||||
|
||||
if (p == NULL || len <= 1) {
|
||||
if (p == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t len = strlen(buf);
|
||||
|
||||
if (len <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user