--- parser3/src/main/pa_string.C 2001/09/07 17:11:51 1.102.2.1 +++ parser3/src/main/pa_string.C 2001/09/18 16:05:42 1.103 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: pa_string.C,v 1.102.2.1 2001/09/07 17:11:51 parser Exp $"; +static const char *RCSId="$Id: pa_string.C,v 1.103 2001/09/18 16:05:42 parser Exp $"; #include "pa_config_includes.h" @@ -712,13 +712,10 @@ double String::as_double() const { else result=(double)strtod(cstr, &error_pos); - if(error_pos==cstr/*empty*/) - result=0; - else - if(*error_pos/*not eos*/) - THROW(0, 0, - this, - "invalid number (double)"); + if(*error_pos/*not EOS*/) + THROW(0, 0, + this, + "invalid number (double)"); return result; } @@ -735,13 +732,10 @@ int String::as_int() const { else result=(int)strtol(cstr, &error_pos, 0); - if(error_pos==cstr/*empty*/) - result=0; - else - if(*error_pos/*not eos*/) - THROW(0, 0, - this, - "invalid number (int)"); + if(*error_pos/*not EOS*/) + THROW(0, 0, + this, + "invalid number (int)"); return result; }