Skip to content

Commit

Permalink
- Apparently strndup is not supported by mingw, use strdup instead.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13402 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Oct 16, 2012
1 parent 5a36a44 commit 26867a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Compiler/runtime/FMIImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ const char* getModelVariableBaseType(fmi1_import_variable_t* variable)
}

/*
* Reads the model variable base type.
* Reads the model variable name. Returns a malloc'd string that should be
* free'd.
*/
char* getModelVariableName(fmi1_import_variable_t* variable)
{
const char* name = fmi1_import_get_variable_name(variable);
int length = strlen(name);
char* res = strndup(name, length);
char* res = strdup(name);
int length = strlen(res);

charReplace(res, length, '.', '_');
charReplace(res, length, '[', '_');
Expand Down

0 comments on commit 26867a6

Please sign in to comment.