mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8308801: update for deprecated sprintf for libnet in java.base
Reviewed-by: djelinski, rriggs
This commit is contained in:
parent
77c5adb09e
commit
c72b547425
3 changed files with 6 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, 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
|
||||
|
@ -197,7 +197,7 @@ void NET_ThrowUnknownHostExceptionWithGaiError(JNIEnv *env,
|
|||
buf = (char *) malloc(size);
|
||||
if (buf) {
|
||||
jstring s;
|
||||
sprintf(buf, format, hostname, error_string);
|
||||
snprintf(buf, size, format, hostname, error_string);
|
||||
s = JNU_NewStringPlatform(env, buf);
|
||||
if (s != NULL) {
|
||||
jobject x = JNU_NewObjectByName(env,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue