diff options
author | Björn-Egil Dahlberg <[email protected]> | 2012-09-07 12:23:03 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2012-09-07 15:52:34 +0200 |
commit | 7bd69516a3cab79f869fde5787140ae810c35ef8 (patch) | |
tree | cbc7d77e6d3580467524e73af40cfef1540fcd94 /erts/epmd | |
parent | 0c665266aff319f2dc897e5858d59aa2186bebb4 (diff) | |
download | otp-7bd69516a3cab79f869fde5787140ae810c35ef8.tar.gz otp-7bd69516a3cab79f869fde5787140ae810c35ef8.tar.bz2 otp-7bd69516a3cab79f869fde5787140ae810c35ef8.zip |
Replace sprintf with erts_snprintf in epmd
Diffstat (limited to 'erts/epmd')
-rw-r--r-- | erts/epmd/src/epmd.c | 2 | ||||
-rw-r--r-- | erts/epmd/src/epmd_srv.c | 7 |
2 files changed, 5 insertions, 4 deletions
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) |