return 0;
}
- bsnprintf(port, sizeof(port), "%d", mdb->db_port);
+ if (mdb->db_port && mdb->db_port[0]) {
+ bsnprintf(port, sizeof(port), "%d", mdb->db_port);
+ }
/* connect to the database */
mdb->db = PQsetdbLogin(
mdb->db_address, /* default = localhost */
case s_mday: /* day of month */
if (!have_mday) {
clear_bits(0, 30, lrun.mday);
- clear_bits(0, 6, lrun.wday);
have_mday = true;
}
set_bit(code, lrun.mday);
case s_wday: /* week day */
if (!have_wday) {
clear_bits(0, 6, lrun.wday);
- clear_bits(0, 30, lrun.mday);
have_wday = true;
}
set_bit(code, lrun.wday);
}
if (!have_mday) {
clear_bits(0, 30, lrun.mday);
- clear_bits(0, 6, lrun.wday);
have_mday = true;
}
if (code < code2) {
if (state == s_wday) {
if (!have_wday) {
clear_bits(0, 6, lrun.wday);
- clear_bits(0, 30, lrun.mday);
have_wday = true;
}
if (code < code2) {
}
} else if (state == s_month) {
if (!have_month) {
- clear_bits(0, 30, lrun.month);
+ clear_bits(0, 11, lrun.month);
have_month = true;
}
if (code < code2) {
set_bits(code, code2, lrun.month);
} else {
/* this is a bit odd, but we accept it anyway */
- set_bits(code, 30, lrun.month);
+ set_bits(code, 11, lrun.month);
set_bits(0, code2, lrun.month);
}
} else {