From 6e1a24c45eb99a9c9f8e1cb708b64bdc504d5efe Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 14 Jun 2010 20:40:54 +0000 Subject: - Fix comment retrieval issues for <4.1 when retrieving db structure - addresses crashes http://spbug.com/l/540 and http://spbug.com/l/106 --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index f36cff2c..efe65e84 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -2191,7 +2191,12 @@ void performThreadedKeepAlive(void *ptr) NSString *def = [self stringWithCString:row[5] usingEncoding:theConnectionEncoding] ; NSString *extra = [self stringWithCString:row[6] usingEncoding:theConnectionEncoding] ; NSString *priv = [self stringWithCString:row[7] usingEncoding:theConnectionEncoding] ; - NSString *comment = [self stringWithCString:row[8] usingEncoding:theConnectionEncoding] ; + NSString *comment; + if (sizeof(row) > 8) { + comment = [self stringWithCString:row[8] usingEncoding:theConnectionEncoding] ; + } else { + comment = @""; + } NSArray *a = [coll componentsSeparatedByString:@"_"]; charset = ([a count]) ? [a objectAtIndex:0] : @""; -- cgit v1.2.3