From fe2636cb4a3655451ea2b30e31dcd298fc93b049 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 25 Mar 2008 22:41:25 +0000 Subject: [PATCH] Coverty fix: use snprintf instead of sprintf. This commit was SVN r17963. --- orte/util/hostfile/hostfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orte/util/hostfile/hostfile.c b/orte/util/hostfile/hostfile.c index a2400060cf..bb5f54adc1 100644 --- a/orte/util/hostfile/hostfile.c +++ b/orte/util/hostfile/hostfile.c @@ -128,7 +128,6 @@ static orte_node_t* hostfile_lookup(opal_list_t* nodes, const char* name) static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exclude) { - char buff[64]; int rc; orte_node_t* node; bool update = false; @@ -146,9 +145,10 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc ORTE_HOSTFILE_INT == token || ORTE_HOSTFILE_IPV4 == token || ORTE_HOSTFILE_IPV6 == token) { + char buff[64]; if(ORTE_HOSTFILE_INT == token) { - sprintf(buff,"%d", orte_util_hostfile_value.ival); + snprintf(buff, 64, "%d", orte_util_hostfile_value.ival); value = buff; } else { value = orte_util_hostfile_value.sval;