From 2051682c03c7991465b8cc6a20cc13261867390c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 11 Sep 2014 08:48:37 +0200 Subject: [PATCH] cron: Fix possible division by zero error --- src/cron.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cron.c b/src/cron.c index 997817c6..366139a2 100644 --- a/src/cron.c +++ b/src/cron.c @@ -73,7 +73,7 @@ cron_parse_field if ((sn - off) >= bits || (en - off) >= bits || mn > bits) return 1; if (en < 0) en = sn; - if (mn < 0) mn = 1; + if (mn <= 0) mn = 1; while (sn <= en) { if ( (sn % mn) == 0 ) val |= (0x1ULL << (sn - off));