RFR: 8308071: [REDO] update for deprecated sprintf for src/utils [v3]

Xue-Lei Andrew Fan xuelei at openjdk.org
Wed May 17 15:04:57 UTC 2023


On Wed, 17 May 2023 08:48:37 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   check returned value of snprintf
>
> src/utils/hsdis/binutils/hsdis-binutils.c line 246:
> 
>> 244: 
>> 245:   size_t used_size = snprintf(buf, bufsize, "%s", close);
>> 246:   if ((used_size < 0) || (used_size >= bufsize)) {
> 
> (used_size < 0) is tautologically false, since used_size is a size_t, so unsigned.  I'm somewhat surprised
> this doesn't trigger a warning from some compiler.

Updated to use `int` to replace `size_t.`. Thank you for the catching.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13995#discussion_r1196646900



More information about the build-dev mailing list