Revision: 18166
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18166&view=rev
Author: hofman
Date: 2011-10-08 17:30:37 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
we don't need the final null character to create an NSString from bytes
Modified Paths:
--------------
trunk/bibdesk/NSData_BDSKExtensions.m
Modified: trunk/bibdesk/NSData_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSData_BDSKExtensions.m 2011-10-08 12:32:15 UTC (rev
18165)
+++ trunk/bibdesk/NSData_BDSKExtensions.m 2011-10-08 17:30:37 UTC (rev
18166)
@@ -209,9 +209,6 @@
// Byte accurate calculation of final buffer size
size_t outputBufferSize = ((length / BINARY_UNIT_SIZE) + ((length %
BINARY_UNIT_SIZE) ? 1 : 0)) * BASE64_UNIT_SIZE;
- // Include space for a terminating zero
- outputBufferSize += 1;
-
// Allocate the output buffer
char *outputBuffer = (char *)malloc(outputBufferSize);
if (outputBuffer == NULL)
@@ -250,7 +247,6 @@
outputBuffer[j++] = '=';
outputBuffer[j++] = '=';
}
- 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.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit