From 7bd69516a3cab79f869fde5787140ae810c35ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 7 Sep 2012 12:23:03 +0200 Subject: Replace sprintf with erts_snprintf in epmd --- erts/epmd/src/epmd.c | 2 +- erts/epmd/src/epmd_srv.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'erts/epmd/src') diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c index 2267f9b12b..3577abf6ba 100644 --- a/erts/epmd/src/epmd.c +++ b/erts/epmd/src/epmd.c @@ -64,7 +64,7 @@ int epmd_dbg(int level,int port) /* Utility to debug epmd... */ if(port) { argv[argc++] = "-port"; - sprintf(ibuff,"%d",port); + erts_snprintf(ibuff, sizeof(ibuff), "%d",port); argv[argc++] = ibuff; } argv[argc] = NULL; diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index da575affa1..36565b7438 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -23,6 +23,7 @@ #endif #include "epmd.h" /* Renamed from 'epmd_r4.h' */ #include "epmd_int.h" +#include "erl_printf.h" /* erts_snprintf */ #ifndef INADDR_NONE # define INADDR_NONE 0xffffffff @@ -633,7 +634,7 @@ static void do_request(g, fd, s, buf, bsize) /* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight change in syntax will break < OTP R3A */ - sprintf(wbuf,"name %s at port %d\n",node->symname, node->port); + erts_snprintf(wbuf, sizeof(wbuf), "name %s at port %d\n",node->symname, node->port); len = strlen(wbuf); if (reply(g, fd, wbuf, len) != len) { @@ -669,7 +670,7 @@ static void do_request(g, fd, s, buf, bsize) /* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight change in syntax will break < OTP R3A */ - sprintf(wbuf,"active name <%s> at port %d, fd = %d\n", + erts_snprintf(wbuf, sizeof(wbuf), "active name <%s> at port %d, fd = %d\n", node->symname, node->port, node->fd); len = strlen(wbuf) + 1; if (reply(g, fd,wbuf,len) != len) @@ -686,7 +687,7 @@ static void do_request(g, fd, s, buf, bsize) /* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight change in syntax will break < OTP R3A */ - sprintf(wbuf,"old/unused name <%s>, port = %d, fd = %d \n", + erts_snprintf(wbuf, sizeof(wbuf), "old/unused name <%s>, port = %d, fd = %d \n", node->symname,node->port, node->fd); len = strlen(wbuf) + 1; if (reply(g, fd,wbuf,len) != len) -- cgit v1.2.3