Debug(("Jobs will start in the %02d:00-%02d:00 range.", range_start, range_stop));
}
if (strncmp(env_var, "RANDOM_DELAY", 12) == 0) {
+ int i;
+ double x;
+
r = match_rx("^([[:digit:]]+)$", value, 0);
if (r == -1) goto reg_err;
if (r == 0) goto reg_invalid;
- if (r != -1) {
- int i = random();
- double x = 0;
- x = (double) i / (double) RAND_MAX * (double) (atoi(value));
- random_number = (int)x;
- Debug(("Randomized delay set: %d", random_number));
- }
+
+ i = random();
+ x = (double) i / (double) RAND_MAX * (double) (atoi(value));
+ random_number = (int)x;
+ Debug(("Randomized delay set: %d", random_number));
}
if (strncmp(env_var, "PREFERRED_HOUR", 14) == 0) {
r = match_rx("^([[:digit:]]+)$", value, 1, &pref_hour);
- if ((r != -1) || (pref_hour != NULL)) {
+ if (r == -1) goto reg_err;
+
+ if (r) {
preferred_hour = atoi(pref_hour);
if ((preferred_hour < 0) || (preferred_hour > 24)) {
preferred_hour = -1;