From 2dbae24c7735ead0524bd9847af6ea99d8654ec6 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 14 May 2011 17:26:18 +0000 Subject: Bring outline view branch up to date with trunk (r3279:r3306). --- Frameworks/MCPKit/MCPFoundationKit/MCPResult.m | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPResult.m') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m index 53066c14..84793e44 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m @@ -419,10 +419,7 @@ const OUR_CHARSET our_charsets60[] = if (theRow[i] == NULL) { theCurrentObj = [NSNull null]; } else { - char *theData = calloc(sizeof(char),theLengths[i]+1); - //char *theUselLess; - memcpy(theData, theRow[i],theLengths[i]); - theData[theLengths[i]] = '\0'; + char *theData = theRow[i]; switch (theField[i].type) { case FIELD_TYPE_TINY: @@ -444,7 +441,7 @@ const OUR_CHARSET our_charsets60[] = case FIELD_TYPE_SET: case FIELD_TYPE_ENUM: case FIELD_TYPE_NEWDATE: // Don't know what the format for this type is... - theCurrentObj = [NSString stringWithCString:theData encoding:mEncoding]; + theCurrentObj = [[[NSString alloc] initWithBytes:theData length:theLengths[i] encoding:mEncoding] autorelease]; break; case FIELD_TYPE_BIT: @@ -479,8 +476,6 @@ const OUR_CHARSET our_charsets60[] = break; } - free(theData); - // Some of the creators return nil object... if (theCurrentObj == nil) { theCurrentObj = [NSNull null]; -- cgit v1.2.3