2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00

1458. [cleanup] sprintf() -> snprintf().

This commit is contained in:
Mark Andrews
2003-04-11 07:25:31 +00:00
parent 935000aa6e
commit 806c235ecf
16 changed files with 83 additions and 69 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.55 2002/10/24 03:52:33 marka Exp $ */
/* $Id: sockaddr.c,v 1.56 2003/04/11 07:25:28 marka Exp $ */
#include <config.h>
@@ -120,10 +120,10 @@ isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target) {
*/
switch (sockaddr->type.sa.sa_family) {
case AF_INET:
sprintf(pbuf, "%u", ntohs(sockaddr->type.sin.sin_port));
snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin.sin_port));
break;
case AF_INET6:
sprintf(pbuf, "%u", ntohs(sockaddr->type.sin6.sin6_port));
snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin6.sin6_port));
break;
default:
return (ISC_R_FAILURE);