mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
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:
parent
ab62451740
commit
0b5dd6729b
1 changed files with 10 additions and 0 deletions
|
@ -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':
|
||||
|
|
Loading…
Reference in a new issue