Binary compare failing in SUUpdater parameterizedFeedURL method #278

Open
psychicpuppy opened this Issue Jun 11, 2013 · 0 comments

Comments

Projects
None yet
1 participant

This line of code in parameterizedFeedURL fails for me (line 4800;

sendingSystemProfile &= (-[lastSubmitDate timeIntervalSincenow] >= oneWeek);

This is always NO for me even when sendingSystemProfile is YES and lastSubmitDate is distandPast. Turns out the problem is the binary compare &=. If I break out the compare against oneWeek into a separate BOOL say:

BOOL timeLapsed = (-[lastSubmitDate timeIntervalSincenow] >= oneWeek);

and then change the logic to be:

sendSystemProfile = sendSystemProfile && timeLapsed;

it works ok. I've had this issue before in C code where the binary compare is not reliable. You need to use the Boolean compare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment