gPass

gPass Commit Details

Date:2017-07-19 19:11:52 (2 years 2 months ago)
Author:Grégory Soutadé
Branch:master
Commit:39582e0f264bf7e69c647f126c418a878b56bfa8
Parents: 86e926e268f72576fbe74c41ca548e025388aa1c
Message:CLI: Use printf return to compute string size instead of hardcoded values

Changes:
Mcli/main.c (1 diff)

File differences

cli/main.c
8181
8282
8383
84
84
8585
8686
8787
88
88
8989
9090
9191
9292
9393
94
9495
95
96
96
9797
9898
9999
static void display_password(char* password, int time)
{
int length;
int print_len = 0;
for (; time && !s_stop_display; time--)
{
printf("\r(%02d) Password found: %s", time, password);
print_len = printf("\r(%02d) Password found: %s", time, password);
fflush(stdout);
sleep(1);
}
// Clear line
print_len++; // For C or Z
printf("\r");
length = 4 + 17 + strlen(password) + 1 + 1 /* For Ctrl+Z/C */;
while (length--)
while (print_len--)
printf(" ");
printf("\n");
}

Archive Download the corresponding diff file