On Wed, 16 Nov 2022 04:55:17 GMT, Kim Barrett <[email protected]> wrote:

>> The problem with using the return value of os::snprintf() is that we need to 
>> handle the -1 case to prevent the position from running backward. Might be 
>> better to use stringStream instead, which should handle the -1 case 
>> transparently.
>
> A result of -1 only occurs for an encoding error.  An encoding error is only
> possible with multi-byte / wide characters.  (See the definition of "encoding
> error" in C99 7.19.3/14.) We don't use those, so there won't be any encoding
> errors, so our uses of snprintf never return -1.

Updated to use the result from `os::snprtinf` in the new commit.

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

PR: https://git.openjdk.org/jdk/pull/11115

Reply via email to