@@ -30,10 +30,11 @@ #import "OFDictionary.h" #import "OFXMLElement.h" #ifdef OF_THREADS # import "OFMutex.h" #endif +#import "OFSystemInfo.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" @@ -512,10 +513,11 @@ - (OFString*)dateStringWithFormat: (OFConstantString*)format { OFString *ret; time_t seconds_ = (time_t)seconds; struct tm tm; + size_t pageSize; char *buffer; if (seconds_ != floor(seconds)) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; @@ -540,14 +542,15 @@ [mutex unlock]; } # endif #endif - buffer = [self allocMemoryWithSize: of_pagesize]; + pageSize = [OFSystemInfo pageSize]; + buffer = [self allocMemoryWithSize: pageSize]; @try { - if (!strftime(buffer, of_pagesize, [format UTF8String], &tm)) + if (!strftime(buffer, pageSize, [format UTF8String], &tm)) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; ret = [OFString stringWithUTF8String: buffer]; } @finally { @@ -560,10 +563,11 @@ - (OFString*)localDateStringWithFormat: (OFConstantString*)format { OFString *ret; time_t seconds_ = (time_t)seconds; struct tm tm; + size_t pageSize; char *buffer; if (seconds_ != floor(seconds)) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; @@ -588,14 +592,15 @@ [mutex unlock]; } # endif #endif - buffer = [self allocMemoryWithSize: of_pagesize]; + pageSize = [OFSystemInfo pageSize]; + buffer = [self allocMemoryWithSize: pageSize]; @try { - if (!strftime(buffer, of_pagesize, [format UTF8String], &tm)) + if (!strftime(buffer, pageSize, [format UTF8String], &tm)) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; ret = [OFString stringWithUTF8String: buffer]; } @finally {