Skip to content

Commit

Permalink
Enforce lower bound on --interval
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolasburr committed Oct 2, 2017
1 parent 114f078 commit aa91895
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ int main (int argc, char **argv) {
}

interval = atoi(s_interval);

/**
* Enforce strict lower bound of 10 seconds.
*/
if (interval < 10) {
fprintf(stderr, "--interval: To prevent overload, interval must be >= 10.\n");

exit(EXIT_FAILURE);
}
} else {
interval = GIT_STASHD_INTERVAL;
}
Expand Down

0 comments on commit aa91895

Please sign in to comment.