diff options
author | Stuart Connolly <stuart02@gmail.com> | 2014-01-13 16:00:48 +0000 |
---|---|---|
committer | Stuart Connolly <stuart02@gmail.com> | 2014-01-13 16:00:48 +0000 |
commit | 5fbb1aca370ee09c9cdda7f96cc771cb3e1c249d (patch) | |
tree | c506ec7d2e5ce5e095c4e612256f02845ef6ef1e /Source/SPDataAdditions.m | |
parent | 34983d4ab09107c3f4d4d53cc0d39b9fd35c22fb (diff) | |
download | sequelpro-5fbb1aca370ee09c9cdda7f96cc771cb3e1c249d.tar.gz sequelpro-5fbb1aca370ee09c9cdda7f96cc771cb3e1c249d.tar.bz2 sequelpro-5fbb1aca370ee09c9cdda7f96cc771cb3e1c249d.zip |
Tidy up.
Diffstat (limited to 'Source/SPDataAdditions.m')
-rw-r--r-- | Source/SPDataAdditions.m | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/SPDataAdditions.m b/Source/SPDataAdditions.m index 401ffbc8..9b336581 100644 --- a/Source/SPDataAdditions.m +++ b/Source/SPDataAdditions.m @@ -175,11 +175,9 @@ if (deflateInit(&zlibStream, Z_DEFAULT_COMPRESSION) != Z_OK) return nil; - NSMutableData *zipData = [NSMutableData dataWithLength:16384]; - do{ - + do { if (zlibStream.total_out >= [zipData length]) [zipData increaseLengthBy: 16384]; @@ -188,11 +186,13 @@ deflate(&zlibStream, Z_FINISH); - } while(zlibStream.avail_out == 0); + } + while(zlibStream.avail_out == 0); deflateEnd(&zlibStream); [zipData setLength: zlibStream.total_out]; + return [NSData dataWithData: zipData]; } @@ -206,7 +206,8 @@ NSUInteger dataLength = [self length]; NSMutableString *hexString = [NSMutableString string]; - for (i = 0; i < dataLength; i++) { + for (i = 0; i < dataLength; i++) + { [hexString appendFormat:@"%02X", bytes[i]]; } |