Skip to content

Commit

Permalink
- Fix stringCharInt returning negative integers
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9033 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed May 18, 2011
1 parent 127a714 commit 4ab151f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion c_runtime/meta_modelica_builtin.cpp
Expand Up @@ -72,10 +72,12 @@ modelica_metatype boxptr_intMax(modelica_metatype a,modelica_metatype b)

stringCharInt_rettype stringCharInt(metamodelica_string chr)
{
unsigned char c;
if (MMC_STRLEN(chr) != 1)
MMC_THROW();
MMC_CHECK_STRING(chr);
return (int) MMC_STRINGDATA(chr)[0];
c = (unsigned char) MMC_STRINGDATA(chr)[0];
return c;
}

intStringChar_rettype intStringChar(modelica_integer ix)
Expand Down

0 comments on commit 4ab151f

Please sign in to comment.