Changeset d83b5e72


Ignore:
Timestamp:
11/19/18 16:37:40 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
d5eb96d
Parents:
0d451ef
Message:

Fix output dir optarg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/stats/ipdist-parallel.c

    r91852de2 rd83b5e72  
    426426
    427427        /* Finaly output the results */
    428         printf("Generating output \"%sipdist-%lu\"\n", stats_outputdir, tick);
     428        printf("Generating output \"%s/ipdist-%lu\"\n", stats_outputdir, tick);
    429429
    430430        /* Output the results */
    431431        char outputfile[255];
    432         snprintf(outputfile, sizeof(outputfile), "%sipdist-%lu.data", stats_outputdir, tick);
     432        snprintf(outputfile, sizeof(outputfile), "%s/ipdist-%lu.data", stats_outputdir, tick);
    433433        FILE *tmp = fopen(outputfile, "w");
    434434        fprintf(tmp, "#time\t\trank\toctet1\t\t\t\toctet2\t\t\t\toctet3\t\t\t\toctet4\n");
     
    450450
    451451        char outputfile_stats[255];
    452         snprintf(outputfile_stats, sizeof(outputfile_stats), "%sipdist-%lu.stats", stats_outputdir, tick);
     452        snprintf(outputfile_stats, sizeof(outputfile_stats), "%s/ipdist-%lu.stats", stats_outputdir, tick);
    453453        tmp = fopen(outputfile_stats, "w");
    454454        /* append stats data to end of file */
     
    632632
    633633        while(1) {
    634                 int option_index;
     634                int option_index = 0;
    635635                struct option long_options[] = {
    636636                        { "set-uri",            1, 0, 'i' },
     
    672672                        case 'd':
    673673                                stats_outputdir = optarg;
    674                                 strcat(stats_outputdir, "/");
     674                                break;
    675675                        case '?':
    676676                                break;
Note: See TracChangeset for help on using the changeset viewer.