now_t += 5;
now_t += 60; /* add 1 min */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += 60; /* add 1 min */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
localtime_r(&now_t, &now_s);
- if (28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
+ if (now_s.tm_mday < 2 || 28 < now_s.tm_mday) /* if mday goes over 28, alarm needs more params */
return 0;
if (0 == now_s.tm_mon) { /* Jan */
now_s.tm_year--;