RFR: 8254270: linux 32 bit build doesn't compile libjdwp/log_messages.c [v3]
Claes Redestad
redestad at openjdk.java.net
Thu Nov 5 22:25:02 UTC 2020
On Thu, 5 Nov 2020 22:11:44 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use Thomas's fix instead.
>
> src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c line 82:
>
>> 80: "%Z", localtime(&t));
>> 81: // Truncate milliseconds in buffer large enough to hold the
>> 82: // value which is always < 1000
>
> I initially missed the %d to %s change. Can we augment the comment to say:
>
> // value which is always < 1000 (and so a maximum of 3 digits for "%.3s")
>
> Also I'm not clear whether this will result in extra spaces when the ms value is < 100 ?
Right, `snprintf(tmp, sizeof(tmp), "%d", millisecs);` needs to be
`snprintf(tmp, sizeof(tmp), "%.3d", millisecs);` to pad it out correctly.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1067
More information about the serviceability-dev
mailing list