jhb says a 10 line change containing casts is more invasive than a 28 line

change.
This commit is contained in:
obrien 2001-07-31 16:25:55 +00:00
parent 70d2b7c511
commit 1f7029dd10

View File

@ -1006,7 +1006,7 @@ parseDWM(char *s)
{
char *t;
struct tm tm, *tmp;
u_long ul;
long l;
int nd;
static int mtab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int WMseen = 0;
@ -1035,10 +1035,10 @@ parseDWM(char *s)
return -1;
Dseen++;
s++;
ul = strtoul(s, &t, 10);
if (ul > 23)
l = strtol(s, &t, 10);
if (l < 0 || l > 23)
return -1;
tm.tm_hour = ul;
tm.tm_hour = l;
break;
case 'W':
@ -1046,17 +1046,17 @@ parseDWM(char *s)
return -1;
WMseen++;
s++;
ul = strtoul(s, &t, 10);
if (ul > 6)
l = strtol(s, &t, 10);
if (l < 0 || l > 6)
return -1;
if (ul != (unsigned)tm.tm_wday) {
if (l != tm.tm_wday) {
int save;
if (ul < (unsigned)tm.tm_wday) {
if (l < tm.tm_wday) {
save = 6 - tm.tm_wday;
save += (ul + 1);
save += (l + 1);
} else {
save = ul - tm.tm_wday;
save = l - tm.tm_wday;
}
tm.tm_mday += save;
@ -1078,13 +1078,13 @@ parseDWM(char *s)
s++;
t = s;
} else {
ul = strtoul(s, &t, 10);
if (ul < 1 || ul > 31)
l = strtol(s, &t, 10);
if (l < 1 || l > 31)
return -1;
if (ul > (unsigned)nd)
if (l > nd)
return -1;
tm.tm_mday = ul;
tm.tm_mday = l;
}
break;