On Mon, 22 Dec 2025 14:25:46 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

>> Damon Nguyen has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Update printf
>
> src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 231:
> 
>> 229:                 char str[100] = 
>> "assistive_technologies=com.sun.java.accessibility.AccessBridge\n";
>> 230:                 strcat_s(str, "screen_magnifier_present=true\n");
>> 231:                 fprintf(origFile, "%s", str);
> 
> Why do we need the `str` buffer at all?
> 
> Shouldn't `fprintf` be enough?
> 
> 
> fprintf(origFile,
>     "assistive_technologies=com.sun.java.accessibility.AccessBridge\n"
>     "screen_magnifier_present=true\n");

Updated, thanks!

> src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 321:
> 
>> 319:     strcat_s(outputString, versionString);
>> 320:     strcat_s(outputString, "\njabswitch enables or disables the Java 
>> Access Bridge.\n");
>> 321:     printf("%s", outputString);
> 
> Same for the `outputString`
> 
> 
> printf(
>     "jabswitch %s\n"
>     "jabswitch enables or disables the Java Access Bridge.\n",
>     versionString
> );

I have also updated this. I was initially skeptical of the implications of 
replacing the vars entirely, but now I agree that this replacement should be 
safer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28949#discussion_r2641189410
PR Review Comment: https://git.openjdk.org/jdk/pull/28949#discussion_r2641191643

Reply via email to