1
1

len is assigned during the big for loop() in this function, so assuming

the initialization in the start of the function is going to remain for
the life of the function is erroneous.  Need to initialize before
using in the snprintf() call.

Refs trac:340

This commit was SVN r11781.

The following Trac tickets were found above:
  Ticket 340 --> https://svn.open-mpi.org/trac/ompi/ticket/340
Этот коммит содержится в:
Brian Barrett 2006-09-25 15:34:50 +00:00
родитель 38b34b6a7c
Коммит fa0ae7aa52

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

@ -482,7 +482,7 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
*/
char *opal_cmd_line_get_usage_msg(opal_cmd_line_t *cmd)
{
size_t i, len = MAX_WIDTH * 2, prev_len;
size_t i, len, prev_len;
int argc;
size_t j;
char **argv;
@ -555,6 +555,7 @@ char *opal_cmd_line_get_usage_msg(opal_cmd_line_t *cmd)
}
strcat(line, " ");
for (i = 0; (int)i < option->clo_num_params; ++i) {
len = sizeof(temp);
snprintf(temp, len, "<arg%d> ", (int)i);
strcat(line, temp);
}