summaryrefslogtreecommitdiff
path: root/missing_d/strptime.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing_d/strptime.c')
-rw-r--r--missing_d/strptime.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/missing_d/strptime.c b/missing_d/strptime.c
index 670c5320..5e87f618 100644
--- a/missing_d/strptime.c
+++ b/missing_d/strptime.c
@@ -571,6 +571,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
character for character and construct the result while
doing this. */
time_t secs = 0;
+ struct tm *then;
if (*rp < '0' || *rp > '9')
/* We need at least one digit. */
return NULL;
@@ -582,9 +583,11 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
}
while (*rp >= '0' && *rp <= '9');
- if (localtime_r (&secs, tm) == NULL)
+ if ((then = localtime (&secs)) == NULL)
/* Error in function. */
return NULL;
+ else
+ *tm = *then;
}
break;
case 'S':