use int instead of time_t to print timezone info
authorVladimir Petko <vladimir.petko@canonical.com>
Tue, 30 Jul 2024 06:37:36 +0000 (08:37 +0200)
committerMatthias Klose <doko@ubuntu.com>
Tue, 30 Jul 2024 06:37:36 +0000 (08:37 +0200)
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

index d27d34d7a814ee07a3217c562ec2f37bc03642db..f0fe3177a66ac3b51ffd8978701892b1759948e9 100644 (file)
@@ -197,8 +197,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