A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check that table[0].name is defined.
[simgrid.git]
/
src
/
surf
/
surf.c
diff --git
a/src/surf/surf.c
b/src/surf/surf.c
index
de54e43
..
807bfaf
100644
(file)
--- a/
src/surf/surf.c
+++ b/
src/surf/surf.c
@@
-233,7
+233,9
@@
int find_model_description(s_surf_model_description_t * table,
if (!strcmp(name, table[i].name)) {
return i;
}
if (!strcmp(name, table[i].name)) {
return i;
}
- name_list = strdup(table[0].name);
+ if (!table[0].name)
+ xbt_die("No model is valid! This is a bug.");
+ name_list = xbt_strdup(table[0].name);
for (i = 1; table[i].name; i++) {
name_list =
xbt_realloc(name_list,
for (i = 1; table[i].name; i++) {
name_list =
xbt_realloc(name_list,