Check for bad day/month

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/base-1_13_0@24161 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-11-25 06:47:07 +00:00
parent ab62451740
commit 0b5dd6729b

View file

@ -1068,6 +1068,11 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
sourceIdx += getDigits(&source[sourceIdx], tmpStr, 2, &error);
day = atoi(tmpStr);
had |= hadD;
if (error == NO && day < 1)
{
error = YES;
NSDebugMLog(@"Day of month is zero");
}
break;
case 'F':
@ -1093,6 +1098,11 @@ static inline int getDigits(const char *from, char *to, int limit, BOOL *error)
sourceIdx += getDigits(&source[sourceIdx], tmpStr, 2, &error);
month = atoi(tmpStr);
had |= hadM;
if (error == NO && month < 1)
{
error = YES;
NSDebugMLog(@"Month of year is zero");
}
break;
case 'M':