From 6fe4c1cf120082f68c9779997031d54c25696d5b Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Thu, 24 Apr 2025 02:05:43 +0200 Subject: [PATCH] use int instead of time_t to print timezone info Bug: https://bugs.openjdk.org/browse/JDK-8334502 Last-Update: 2024-06-19 printf() call uses %02d format specifier that requires an int parameter. Gbp-Pq: Name jdk-8334502-proposed.patch --- src/hotspot/share/runtime/os.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index c846408fb..eb7d7ffa5 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -192,8 +192,8 @@ char* os::iso8601_time(jlong milliseconds_since_19700101, char* buffer, size_t b abs_local_to_UTC = -(abs_local_to_UTC); } // Convert time zone offset seconds to hours and minutes. - const time_t zone_hours = (abs_local_to_UTC / seconds_per_hour); - const time_t zone_min = + const int zone_hours = (abs_local_to_UTC / seconds_per_hour); + const int zone_min = ((abs_local_to_UTC % seconds_per_hour) / seconds_per_minute); // Print an ISO 8601 date and time stamp into the buffer -- 2.30.2