Fix static analyzer warning #11

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

ysoldak commented Nov 8, 2011

XCode's "Analyze" action discovers several issues in "MPLib/lib/NSData_Base64/NSData+MPBase64.m"
They all can be fixed by nullifying respective array with a single line.

iOS developers usually do Analyze before submitting their app to review and issues in a lib would not make them happy.

(This is not my solution, but I've just merged it to my fork from another fork appsocial@6fe14ab)

pmj commented on 6fe14ab Jun 17, 2012

How about changing this to

unsigned char accumulated[BASE64_UNIT_SIZE] = {0};

That's a lot shorter and, IMO, clearer. (As per the C standard, the remaining elements will also be initialised to 0)

Contributor
kasrak commented Jun 28, 2012

This has been fixed. Thanks!

@kasrak kasrak closed this Jun 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment