diff --git a/src/options.c b/src/options.c index 86a6fd6e..7dafed2d 100644 --- a/src/options.c +++ b/src/options.c @@ -390,7 +390,8 @@ void optionsParse(int argc, char *argv[]) opt.delaySelection = *optarg == 'b'; if (opt.delaySelection) ++optarg; - opt.delay = optionsParseNum(optarg, 0, INT_MAX, &errmsg); + /* NOTE: div 1000 so that converting to milliseconds doesn't overflow */ + opt.delay = optionsParseNum(optarg, 0, INT_MAX/1000, &errmsg); if (errmsg) { errx(EXIT_FAILURE, "option --delay: '%s' is %s", optarg, errmsg);