Browse Source

Change strptime so that it only modifies struct tm fields specified.

Manuel Novoa III 20 years ago
parent
commit
9d4c823b84
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libc/misc/time/time.c

+ 3 - 1
libc/misc/time/time.c

@@ -1406,7 +1406,9 @@ char *__XL(strptime)(const char *__restrict buf, const char *__restrict format,
 
 			i = 0;
 			do {				/* Store the values into tm. */
-				((int *) tm)[i] = fields[i];
+				if (fields[i] != INT_MIN) {
+					((int *) tm)[i] = fields[i];
+				}
 			} while (++i < 8);
 
 			return (char *) buf; /* Success. */