From 19bde59d3eae295d907e41a4185cd487ae780123 Mon Sep 17 00:00:00 2001 From: Stuart Connolly Date: Sat, 30 Nov 2013 20:13:45 +0000 Subject: Fix warning. --- .../Source/SPMySQLResult Categories/Data Conversion.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 80b198d5..9b0f07d6 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -219,10 +219,16 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt // Generate a nul-terminated C string representation of the binary data char *cStringBuffer = malloc(padLength + 1); cStringBuffer[padLength] = '\0'; - while (i < bitLength) { - cStringBuffer[padLength - ++i] = ( (bytes[length - 1 - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0'; + + while (i < bitLength) + { + ++i; + + cStringBuffer[padLength - i] = ((bytes[length - 1 - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0'; } - while (i++ < padLength) { + + while (i++ < padLength) + { cStringBuffer[padLength - i] = '0'; } @@ -231,6 +237,7 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt // Free up memory and return free(cStringBuffer); + return returnString; } -- cgit v1.2.3