Skip to content

Commit 5403f1f

Browse files
committed
---
yaml --- r: 86008 b: refs/heads/dist-snap c: 30fc2c8 h: refs/heads/master v: v3
1 parent d5965b5 commit 5403f1f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 617850131b795312c4dd404ae7d853b54d883105
9+
refs/heads/dist-snap: 30fc2c8df2fc565b20d8df3a202cb0c7d089afd0
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/rt/rust_builtin.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,16 @@ rust_localtime(int64_t sec, int32_t nsec, rust_tm *timeptr) {
321321
time_t s = sec;
322322
LOCALTIME(&s, &tm);
323323

324+
const char* zone = NULL;
324325
#if defined(__WIN32__)
325326
int32_t gmtoff = -timezone;
326-
char zone[64];
327-
strftime(zone, sizeof(zone), "%Z", &tm);
327+
char buffer[64];
328+
if (strftime(buffer, sizeof(buffer), "%Z", &tm) > 0) {
329+
zone = buffer;
330+
}
328331
#else
329332
int32_t gmtoff = tm.tm_gmtoff;
330-
const char *zone = tm.tm_zone;
333+
zone = tm.tm_zone;
331334
#endif
332335

333336
tm_to_rust_tm(&tm, timeptr, gmtoff, zone, nsec);

0 commit comments

Comments
 (0)