Skip to content

Commit

Permalink
Merge pull request #678 from knn-k/macosSprintf
Browse files Browse the repository at this point in the history
macOS: Stop using sprintf in java.desktop
  • Loading branch information
pshipton committed Jul 10, 2023
2 parents 1d551ab + 8bca5d5 commit 8d52f27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ void PORT_GetControls(void* id, INT32 portIndex, PortControlCreator* creator) {
CFRelease(cfname);
} else {
channelName = (char *)malloc(16);
sprintf(channelName, "Ch %d", ch);
snprintf(channelName, 16, "Ch %d", ch);
}

void* jControls[2];
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/macosx/native/sun/font/AWTStrike.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ + (AWTStrike *) awtStrikeForFont:(AWTFont *)awtFont
#define AWT_FONT_CLEANUP_FINISH \
if (_fontThrowJavaException == YES) { \
char s[512]; \
sprintf(s, "%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__); \
snprintf(s, sizeof(s), "%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__); \
[JNFException raise:env as:kRuntimeException reason:s]; \
}

Expand Down

0 comments on commit 8d52f27

Please sign in to comment.