Anonymous avatar Anonymous committed ad2796f

Fixed ambiguous order of operations. Thanks to Augie Fackler and -Wall (both in Adium) for finding these.

Comments (0)

Files changed (1)

Parser/NSCalendarDate+ISO8601Parsing.m

 							if(num_digits == 1U) //implied decade
 								year += century - (current_year % 10U);
 
-							if(*ch == '-')
-							{
-								month_or_week = read_segment_2digits(++ch, &ch);
+							if(*ch == '-') {
+								++ch;
+								month_or_week = read_segment_2digits(ch, &ch);
 								NSLog(@"(%@) month is %u", str, month_or_week);
 							}
 
 						case 2: //--MM; --MM-DD
 							year = [now yearOfCommonEra];
 							month_or_week = segment;
-							if(*ch == '-')
-								day = read_segment_2digits(++ch, &ch);
+							if(*ch == '-') {
+								++ch;
+								day = read_segment_2digits(ch, &ch);
+							}
 							break;
 
 						case 3: //---DD
 			if(isdigit(*ch)) {
 				hour = read_segment_2digits(ch, &ch);
 				if(*ch == ':') {
-					minute = read_double(++ch, &ch);
+					++ch;
+					minute = read_double(ch, &ch);
 					second = modf(minute, &minute);
 					if(second > DBL_EPSILON)
 						second *= 60.0; //Convert fraction (e.g. .5) into seconds (e.g. 30).
-					else if(*ch == ':')
-						second = read_double(++ch, &ch);
+					else if(*ch == ':') {
+						++ch;
+						second = read_double(ch, &ch);
+					}
 				}
 
 				switch(*ch) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.