1
0
Fork 0
forked from soccera/rdo

Rename sleep_ms to sleep_us

The variable name was misleading, as we didn't calculate the time to
sleep in milliseconds, but in microseconds.
This commit is contained in:
sw1tchbl4d3 2022-03-08 17:03:14 +01:00
parent 368026d4b4
commit 5404c11700

6
rdo.c
View file

@ -47,7 +47,7 @@ void runprog(char** program_argv) {
int main(int argc, char** argv) {
char username[64], wrong_pw_sleep[64], session_ttl[64], password[128];
unsigned int sleep_ms, tries, ts_ttl;
unsigned int sleep_us, tries, ts_ttl;
if (argc == 1) {
printf("RootDO version: %s\n\n", VERSION);
@ -70,7 +70,7 @@ int main(int argc, char** argv) {
getconf(fp, "username", username, sizeof(username));
getconf(fp, "wrong_pw_sleep", wrong_pw_sleep, sizeof(wrong_pw_sleep));
getconf(fp, "session_ttl", session_ttl, sizeof(session_ttl));
sleep_ms = atoi(wrong_pw_sleep) * 1000;
sleep_us = atoi(wrong_pw_sleep) * 1000;
ts_ttl = atoi(session_ttl) * 60;
fclose(fp);
@ -111,7 +111,7 @@ int main(int argc, char** argv) {
runprog(&argv[1]);
}
usleep(sleep_ms);
usleep(sleep_us);
fprintf(stderr, "Wrong password.\n");
tries++;
}