Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -226,9 +226,9 @@ int modify(bool enable) {
printf("Couldn't create file: %s\n", path);
perror("Error");
} else {
char str[100] = "assistive_technologies=com.sun.java.accessibility.AccessBridge\n";
strcat_s(str, "screen_magnifier_present=true\n");
fprintf(origFile, str);
fprintf(origFile, "%s",
"assistive_technologies=com.sun.java.accessibility.AccessBridge\n"
"screen_magnifier_present=true\n");
fclose(origFile);
}
} else {
Expand Down Expand Up @@ -314,11 +314,11 @@ void printVersion() {
pVSInfo->dwProductVersionMS & 0xFFFF,
pVSInfo->dwProductVersionLS >> 16,
pVSInfo->dwProductVersionLS & 0xFFFF );
char outputString[100];
strcpy_s(outputString, "jabswitch ");
strcat_s(outputString, versionString);
strcat_s(outputString, "\njabswitch enables or disables the Java Access Bridge.\n");
printf(outputString);
printf(
"jabswitch %s\n"
"jabswitch enables or disables the Java Access Bridge.\n",
versionString
);
Comment on lines +317 to +321
Copy link
Member

@aivanov-jdk aivanov-jdk Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If versionString isn't used for anything else, we can remove the versionString variable and the call to sprintf_s and put the arguments to print the version directly into the printf call.

}

int regEnable() {
Expand Down