From ef1c1ddf68e7219b055ae707b3f8c825d7c787b7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 9 Nov 2022 11:58:37 +0900 Subject: [PATCH] Use `rb_sprintf` instead of deprecated `sprintf` --- ext/socket/raddrinfo.c | 3 +-- 1 file changed, 1 insertion(+), 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;