1
1

Coverty fix: use snprintf instead of sprintf.

This commit was SVN r17963.
Этот коммит содержится в:
George Bosilca 2008-03-25 22:41:25 +00:00
родитель 2e46a53b0a
Коммит fe2636cb4a

Просмотреть файл

@ -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) static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exclude)
{ {
char buff[64];
int rc; int rc;
orte_node_t* node; orte_node_t* node;
bool update = false; 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_INT == token ||
ORTE_HOSTFILE_IPV4 == token || ORTE_HOSTFILE_IPV4 == token ||
ORTE_HOSTFILE_IPV6 == token) { ORTE_HOSTFILE_IPV6 == token) {
char buff[64];
if(ORTE_HOSTFILE_INT == token) { if(ORTE_HOSTFILE_INT == token) {
sprintf(buff,"%d", orte_util_hostfile_value.ival); snprintf(buff, 64, "%d", orte_util_hostfile_value.ival);
value = buff; value = buff;
} else { } else {
value = orte_util_hostfile_value.sval; value = orte_util_hostfile_value.sval;