
enum {
    ...
    ERR_MONTH_RANGE,
    ...
};
...

if (month < 1 || month > 12) report_error(ERR_MONTH_RANGE);
