Skip to content

Commit 848c7ed

Browse files
committed
tolerate NULL tm_zone in strftime
1 parent 7d273f1 commit 848c7ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/library.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -5273,6 +5273,8 @@ LibraryManager.library = {
52735273
// size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);
52745274
// http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
52755275

5276+
var tm_zone = {{{ makeGetValue('tm', C_STRUCTS.tm.tm_zone, 'i32') }}};
5277+
52765278
var date = {
52775279
tm_sec: {{{ makeGetValue('tm', C_STRUCTS.tm.tm_sec, 'i32') }}},
52785280
tm_min: {{{ makeGetValue('tm', C_STRUCTS.tm.tm_min, 'i32') }}},
@@ -5284,7 +5286,7 @@ LibraryManager.library = {
52845286
tm_yday: {{{ makeGetValue('tm', C_STRUCTS.tm.tm_yday, 'i32') }}},
52855287
tm_isdst: {{{ makeGetValue('tm', C_STRUCTS.tm.tm_isdst, 'i32') }}},
52865288
tm_gmtoff: {{{ makeGetValue('tm', C_STRUCTS.tm.tm_gmtoff, 'i32') }}},
5287-
tm_zone: Pointer_stringify( {{{ makeGetValue('tm', C_STRUCTS.tm.tm_zone, 'i32') }}} )
5289+
tm_zone: tm_zone ? Pointer_stringify(tm_zone) : ''
52885290
};
52895291

52905292
var pattern = Pointer_stringify(format);

0 commit comments

Comments
 (0)