diff options
author | Ron Yorston <rmy@pobox.com> | 2014-01-21 20:02:23 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-01-21 20:02:23 +0000 |
commit | 91229e15fe0cbc76eeae6f389879a42bff443f70 (patch) | |
tree | 0e42b5f4fa3e5dd92d5ca1f412e264500748f7a9 | |
parent | 883817e32ce3173fdd49616b86368614e58b9354 (diff) | |
download | busybox-w32-91229e15fe0cbc76eeae6f389879a42bff443f70.tar.gz busybox-w32-91229e15fe0cbc76eeae6f389879a42bff443f70.tar.bz2 busybox-w32-91229e15fe0cbc76eeae6f389879a42bff443f70.zip |
win32: use emulated localtime_r in strptime
-rw-r--r-- | win32/strptime.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/win32/strptime.c b/win32/strptime.c index 64fd37779..89fb8b736 100644 --- a/win32/strptime.c +++ b/win32/strptime.c | |||
@@ -337,7 +337,6 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) | |||
337 | character for character and construct the result while | 337 | character for character and construct the result while |
338 | doing this. */ | 338 | doing this. */ |
339 | time_t secs = 0; | 339 | time_t secs = 0; |
340 | struct tm *mytm; | ||
341 | if (*rp < '0' || *rp > '9') | 340 | if (*rp < '0' || *rp > '9') |
342 | /* We need at least one digit. */ | 341 | /* We need at least one digit. */ |
343 | return NULL; | 342 | return NULL; |
@@ -349,10 +348,9 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) | |||
349 | } | 348 | } |
350 | while (*rp >= '0' && *rp <= '9'); | 349 | while (*rp >= '0' && *rp <= '9'); |
351 | 350 | ||
352 | if ((mytm=localtime(&secs)) == NULL) | 351 | if (localtime_r (&secs, tm) == NULL) |
353 | /* Error in function. */ | 352 | /* Error in function. */ |
354 | return NULL; | 353 | return NULL; |
355 | *tm = *mytm; | ||
356 | } | 354 | } |
357 | break; | 355 | break; |
358 | case 'S': | 356 | case 'S': |