From b33ff9d65ca4523c5d5a184ac85bec6ca6b39eab Mon Sep 17 00:00:00 2001 From: derics Date: Tue, 20 Nov 2012 22:42:28 -0500 Subject: [PATCH] Fix use of uninitialized variable - localhost. --- src/ior.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ior.c b/src/ior.c index f2d3afe5..e9d6c206 100644 --- a/src/ior.c +++ b/src/ior.c @@ -471,13 +471,6 @@ static int CountTasksPerNode(int numTasks, MPI_Comm comm) unsigned flag; int rc; - if (verbose >= VERBOSE_2 && firstPass) { - char tmp[MAX_STR]; - sprintf(tmp, "task %d on %s", rank, localhost); - OutputToRoot(numTasks, comm, tmp); - firstPass = FALSE; - } - rc = gethostname(localhost, MAX_STR); if (rc == -1) { /* This node won't match task 0's hostname...expect in the @@ -489,6 +482,13 @@ static int CountTasksPerNode(int numTasks, MPI_Comm comm) perror("gethostname() failed"); } + if (verbose >= VERBOSE_2 && firstPass) { + char tmp[MAX_STR]; + sprintf(tmp, "task %d on %s", rank, localhost); + OutputToRoot(numTasks, comm, tmp); + firstPass = FALSE; + } + /* send task 0's hostname to all tasks */ if (rank == 0) strcpy(hostname0, localhost);