diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-09 11:58:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-09 11:58:37 +0900 |
commit | ef1c1ddf68e7219b055ae707b3f8c825d7c787b7 (patch) | |
tree | ad62b561b9be06c15c60591ae9d9aacd3a0a532e | |
parent | 5d95cd99f4ed425c416cc91e8986a3402d5b557a (diff) |
Use `rb_sprintf` instead of deprecated `sprintf`
-rw-r--r-- | ext/socket/raddrinfo.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index a4e1ed37a3..636d1edda3 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -618,8 +618,7 @@ rsock_ipaddr(struct sockaddr *sockaddr, socklen_t sockaddrlen, int norevlookup) family = rb_str_dup(rb_id2str(id)); } else { - sprintf(pbuf, "unknown:%d", sockaddr->sa_family); - family = rb_str_new2(pbuf); + family = rb_sprintf("unknown:%d", sockaddr->sa_family); } addr1 = Qnil; |