--- parser3/src/main/pa_string.C 2013/07/16 15:21:06 1.244 +++ parser3/src/main/pa_string.C 2015/04/08 18:08:53 1.247 @@ -12,7 +12,7 @@ #include "pa_charset.h" #include "pa_vregex.h" -volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.244 2013/07/16 15:21:06 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.247 2015/04/08 18:08:53 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -37,9 +37,10 @@ unsigned int pa_atoui(const char *str, i base = 10; /* default is 10 */ if (*pos == '0') { ++pos; - if (*pos == 'x' || *pos == 'X') + if (*pos == 'x' || *pos == 'X'){ ++pos; base=16; + } } } @@ -130,8 +131,8 @@ double pa_atod(const char* str, const St } double result; - if(str[0]=='0') - if(str[1]=='x' || str[1]=='X'){ + if(str[0]=='0') { + if(str[1]=='x' || str[1]=='X') { // 0xABC result=(double)pa_atoui(str, 0, problem_source); return negative ? -result : result; @@ -139,6 +140,7 @@ double pa_atod(const char* str, const St // skip leading 0000, to disable octal interpretation do str++; while(*str=='0'); } + } char *error_pos; result=strtod(str, &error_pos); @@ -959,7 +961,7 @@ void String::Languages::dump() const { } const char* String::v() const { const uint LIMIT_VIEW=20; - char* buf=(char*)malloc(MAX_STRING); + char* buf=(char*)pa_malloc(MAX_STRING); const char*body_view=body.v(); const char*langs_view=langs.v(); snprintf(buf, MAX_STRING,