RFR: 8295017: Remove Windows specific workaround in JLI_Snprintf [v5]

David Holmes dholmes at openjdk.org
Wed Jul 26 06:13:56 UTC 2023


On Wed, 26 Jul 2023 04:31:13 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Thank you!
>> 
>>>If processing string specifier s, S, or Z, format specification processing stops, a NULL is placed at the beginning of the buffer.
>> 
>> I hope this is not an MS extension/implementation detail since I did not find this in any other places.
>
>>@mrserb this change was to a Windows specific file.
> 
> That change removed the windows specific version of the JLI_Snprintf, and now we use
> `#define JLI_Snprintf   snprintf` on all platforms. And my question was about that "cross-platform" `snprintf`. As linked in the comment above on Windows it adds the null at the start of the buffer in case of error when a negative value is returned. But is that specified by the c99?

@mrserb we already had the define for non-Windows, this change just made it unconditional. This change only had an affect on Windows where we removed the custom `JLI_Snprintf` and started using `snprintf` the same as all other platforms.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/10625#issuecomment-1651039136


More information about the core-libs-dev mailing list