aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2013-11-30 20:13:45 +0000
committerStuart Connolly <stuart02@gmail.com>2013-11-30 20:13:45 +0000
commit19bde59d3eae295d907e41a4185cd487ae780123 (patch)
treea3d078388243ccb4b5885ad64313345b492079db
parentdaba58c692dea782b0fae8ffa73ed73cb173a4e4 (diff)
downloadsequelpro-19bde59d3eae295d907e41a4185cd487ae780123.tar.gz
sequelpro-19bde59d3eae295d907e41a4185cd487ae780123.tar.bz2
sequelpro-19bde59d3eae295d907e41a4185cd487ae780123.zip
Fix warning.
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m13
1 files 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;
}