[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSDateFormatter bug fix
From: |
Andreas Hoeschler |
Subject: |
NSDateFormatter bug fix |
Date: |
Tue, 14 Sep 2004 03:51:41 +0200 |
Hi guys,
I just spent 3 hours again to find and fix a bug in base that is really
really unnecessary. Please check par reference paramerters against null
before writing to them.
@implementation NSDateFormatter (GNUstepFix)
- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string
errorDescription:(NSString**)error
{
NSCalendarDate *d = [NSCalendarDate dateWithString:string
calendarFormat:_dateFormat];
if (d == nil)
{
if (_allowsNaturalLanguage)
{
d = [NSCalendarDate dateWithNaturalLanguageString: string];
}
if (d == nil)
{
if (error) *error = @"Couldn't convert to date"; //
<------------------------------
return NO;
}
}
if (anObject) *anObject = d; // <-------------------------------
return YES;
}
@end
Whoever has write privilege, please put this fix into the source tree.
Thanks,
Andreas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- NSDateFormatter bug fix,
Andreas Hoeschler <=