diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 801f22856..549ad5a29 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2007-11-02 Wolfgang Sourdeau + + * iCalDateHolder.m ([iCalDateHolder -awakeAfterUsingSaxDecoder:]): + make use of cStringUsingEncoding: instead of getString:length: to + retrieve the buffer content to work-around a bug in gnustep-base. + 2007-11-01 Wolfgang Sourdeau * CardGroup.m ([CardGroup +parseFromSource:source]): make sure the diff --git a/SOPE/NGCards/iCalDateHolder.m b/SOPE/NGCards/iCalDateHolder.m index c6e73890a..7115447c8 100644 --- a/SOPE/NGCards/iCalDateHolder.m +++ b/SOPE/NGCards/iCalDateHolder.m @@ -130,14 +130,17 @@ static NSTimeZone *gmt = nil; if ([s rangeOfString:@"T"].length == 0 && [s length] == 8) { /* hm, maybe a date without a time? like an allday event! */ int year, month, day; - char buf[16]; - [s getCString:&(buf[0])]; - - buf[9] = '\0'; - day = atoi(&(buf[6])); buf[6] = '\0'; - month = atoi(&(buf[4])); buf[4] = '\0'; - year = atoi(&(buf[0])); + char *buf; + + buf = strdup([s cStringUsingEncoding: NSASCIIStringEncoding]); + day = atoi(buf + 6); + buf[6] = '\0'; + month = atoi(buf + 4); + buf[4] = '\0'; + year = atoi(buf); + free (buf); + date = [NSCalendarDate dateWithYear:year month:month day:day hour:0 minute:0 second:0 timeZone:tz];