Skip to content

Commit

Permalink
-Forgot to change linux implemenation for trimChar bugfix.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4752 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Jan 7, 2010
1 parent afebc0d commit 8b25b38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -453,7 +453,7 @@ RML_END_LABEL
RML_BEGIN_LABEL(System__trimChar)
{
char* str = RML_STRINGDATA(rmlA0);
char char_to_be_trimmed = RML_STRINGDATA(rmlA1)[0];
char char_to_be_trimmed = (char)RML_STRINGDATA(rmlA1)[0];
int length=strlen(str);
int start_pos = 0;
int end_pos = length - 1;
Expand Down Expand Up @@ -2235,8 +2235,8 @@ RML_BEGIN_LABEL(System__trimChar)
}
if(end_pos > start_pos){
res= (char*)malloc(end_pos - start_pos +1);
strncpy(res,&str[start_pos],end_pos - start_pos + 1);
res[end_pos - start_pos + 1] = '\0';
strncpy(res,&str[start_pos],end_pos - start_pos);
res[end_pos - start_pos] = '\0';
rmlA0 = (void*) mk_scon(res);
free(res);
RML_TAILCALLK(rmlSC);
Expand Down

0 comments on commit 8b25b38

Please sign in to comment.