RFR: 8254270: linux 32 bit build doesn't compile libjdwp/log_messages.c [v3]
Coleen Phillimore
coleenp at openjdk.java.net
Fri Nov 6 00:57:58 UTC 2020
On Thu, 5 Nov 2020 22:22:24 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> 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.
timestamp 05.11.2020 19:54:13.100 EST
This is what I get (in a small test program) for 100 ms with the existing code. Is this not right?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1067
More information about the serviceability-dev
mailing list