mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-30 15:22:41 +00:00
8348323: Corrupted timezone string in JVM crash log
Reviewed-by: dholmes, amitkumar, kevinw
This commit is contained in:
parent
3a8680e919
commit
2bef5b4a87
@ -1212,8 +1212,7 @@ void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) {
|
||||
if (localtime_pd(&tloc, &tz) != nullptr) {
|
||||
wchar_t w_buf[80];
|
||||
size_t n = ::wcsftime(w_buf, 80, L"%Z", &tz);
|
||||
if (n > 0) {
|
||||
::wcstombs(buf, w_buf, buflen);
|
||||
if (n > 0 && ::wcstombs(buf, w_buf, buflen) != (size_t)-1) {
|
||||
st->print("Time: %s %s", timestring, buf);
|
||||
} else {
|
||||
st->print("Time: %s", timestring);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user