Add missing calls to super/self initialization in NSDateFormatter.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32185 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2011-02-16 07:39:06 +00:00
parent b96b154e5e
commit ce4afe2874
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2011-02-16 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSDateFormatter.m (-initWithCoder:, -initWithDateFormat:):
Add missing calls to super/self initialization.
2011-02-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/common.h:

View file

@ -242,6 +242,10 @@ static NSDateFormatterBehavior _defaultBehavior = 0;
- (id) initWithCoder: (NSCoder*)aCoder
{
self = [super initWithCoder: aCoder];
if (self == nil)
return nil;
[aCoder decodeValuesOfObjCTypes: "@C", &_dateFormat, &_allowsNaturalLanguage];
return self;
}
@ -249,6 +253,10 @@ static NSDateFormatterBehavior _defaultBehavior = 0;
- (id) initWithDateFormat: (NSString *)format
allowNaturalLanguage: (BOOL)flag
{
self = [self init];
if (self == nil)
return nil;
_dateFormat = [format copy];
_allowsNaturalLanguage = flag;
internal->_behavior = NSDateFormatterBehavior10_0;