-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
{
xbt_dict_t mydict = get_dict();
FILE* fpInput = fopen(inputfile, "r");
- if (fpInput == NULL)
- printf("Error while opening the inputfile");
+ xbt_assert(fpInput != NULL, "Error while opening the inputfile");
fseek(fpInput, 0, 0);
char line[200];
if (fgets(line, 200, fpInput) == NULL)
printf("Error input file is empty!"); // Skipping first row
while (fgets(line, 200, fpInput) != NULL) {
- char *saveptr; /* for strtok_r() */
+ char *saveptr = NULL; /* for strtok_r() */
key = strtok_r(line, "\t", &saveptr);
xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
}
while (fgets(line, MAX_LINE_INJ, fpInput) != NULL) {
- char *saveptr; /* for strtok_r() */
+ char *saveptr = NULL; /* for strtok_r() */
key = strtok_r(line, "\t", &saveptr);
xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);