Revision: 7224
http://skim-app.svn.sourceforge.net/skim-app/?rev=7224&view=rev
Author: hofman
Date: 2011-05-11 11:34:23 +0000 (Wed, 11 May 2011)
Log Message:
-----------
we don't use the trailing null byte so don't add it
Modified Paths:
--------------
trunk/NSData_SKExtensions.m
Modified: trunk/NSData_SKExtensions.m
===================================================================
--- trunk/NSData_SKExtensions.m 2011-05-11 11:25:22 UTC (rev 7223)
+++ trunk/NSData_SKExtensions.m 2011-05-11 11:34:23 UTC (rev 7224)
@@ -172,7 +172,7 @@
- (NSString *)hexString {
size_t length = [self length];
const unsigned char *inputBuffer = (const unsigned char *)[self bytes];
- char *outputBuffer = (char *)malloc(length * 2 + 1);
+ char *outputBuffer = (char *)malloc(length * 2);
if (outputBuffer == NULL)
return nil;
@@ -183,7 +183,6 @@
outputBuffer[j++] = hexEncodeTable[(inputBuffer[i] & 0xF0) >>
4];
outputBuffer[j++] = hexEncodeTable[(inputBuffer[i] & 0x0F)];
}
- outputBuffer[j] = 0;
NSString *result = [[[NSString alloc] initWithBytes:outputBuffer length:j
encoding:NSASCIIStringEncoding] autorelease];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit