@@ -268,17 +268,18 @@ format: (OFString*)format { self = [super init]; @try { + const char *UTF8String = [string UTF8String]; struct tm tm = { 0 }; int16_t tz = 0; tm.tm_isdst = -1; - if (of_strptime([string UTF8String], [format UTF8String], - &tm, &tz) == NULL) + if (of_strptime(UTF8String, [format UTF8String], + &tm, &tz) != UTF8String + [string UTF8StringLength]) @throw [OFInvalidFormatException exception]; _seconds = tmAndTzToTime(&tm, &tz); } @catch (id e) { [self release]; @@ -292,10 +293,11 @@ format: (OFString*)format { self = [super init]; @try { + const char *UTF8String = [string UTF8String]; struct tm tm = { 0 }; /* * of_strptime() can never set this to INT16_MAX, no matter * what is passed to it, so this is a safe way to figure out if * the date contains a time zone. @@ -302,12 +304,12 @@ */ int16_t tz = INT16_MAX; tm.tm_isdst = -1; - if (of_strptime([string UTF8String], [format UTF8String], - &tm, &tz) == NULL) + if (of_strptime(UTF8String, [format UTF8String], + &tm, &tz) != UTF8String + [string UTF8StringLength]) @throw [OFInvalidFormatException exception]; if (tz == INT16_MAX) { #ifndef OF_WINDOWS if ((_seconds = mktime(&tm)) == -1)