@@ -343,10 +343,11 @@ LOCALTIME_RET(tm_yday + 1) } - (OFString*)dateStringWithFormat: (OFString*)fmt { + OFString *ret; time_t sec_ = sec; struct tm tm; char *buf; if (sec != sec_) @@ -378,18 +379,21 @@ @try { if (!strftime(buf, of_pagesize, [fmt cString], &tm)) @throw [OFOutOfRangeException newWithClass: isa]; - return [OFString stringWithCString: buf]; + ret = [OFString stringWithCString: buf]; } @finally { [self freeMemory: buf]; } + + return ret; } - (OFString*)localDateStringWithFormat: (OFString*)fmt { + OFString *ret; time_t sec_ = sec; struct tm tm; char *buf; if (sec != sec_) @@ -421,14 +425,16 @@ @try { if (!strftime(buf, of_pagesize, [fmt cString], &tm)) @throw [OFOutOfRangeException newWithClass: isa]; - return [OFString stringWithCString: buf]; + ret = [OFString stringWithCString: buf]; } @finally { [self freeMemory: buf]; } + + return ret; } - (OFDate*)earlierDate: (OFDate*)date { if ([self compare: date] == OF_ORDERED_DESCENDING)