@@ -2349,11 +2349,7 @@ PySocket_getaddrinfo(PyObject *self, PyObject *args)
23492349 return NULL ;
23502350 }
23512351 if (PyInt_Check (pobj )) {
2352- #ifndef HAVE_SNPRINTF
2353- sprintf (pbuf , "%ld" , PyInt_AsLong (pobj ));
2354- #else
2355- snprintf (pbuf , sizeof (pbuf ), "%ld" , PyInt_AsLong (pobj ));
2356- #endif
2352+ PyOS_snprintf (pbuf , sizeof (pbuf ), "%ld" , PyInt_AsLong (pobj ));
23572353 pptr = pbuf ;
23582354 } else if (PyString_Check (pobj )) {
23592355 pptr = PyString_AsString (pobj );
@@ -2424,11 +2420,7 @@ PySocket_getnameinfo(PyObject *self, PyObject *args)
24242420 n = PyArg_ParseTuple (sa , "si|ii" , & hostp , & port , & flowinfo , scope_id );
24252421 if (n == 0 )
24262422 goto fail ;
2427- #ifdef HAVE_SNPRINTF
2428- snprintf (pbuf , sizeof (pbuf ), "%d" , port );
2429- #else
2430- sprintf (pbuf , "%d" , port );
2431- #endif
2423+ PyOS_snprintf (pbuf , sizeof (pbuf ), "%d" , port );
24322424 memset (& hints , 0 , sizeof (hints ));
24332425 hints .ai_family = PF_UNSPEC ;
24342426 error = getaddrinfo (hostp , pbuf , & hints , & res );
0 commit comments