--- parser3/src/main/pa_string.C 2002/06/24 11:59:33 1.160 +++ parser3/src/main/pa_string.C 2002/06/26 10:35:16 1.162 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: pa_string.C,v 1.160 2002/06/24 11:59:33 paf Exp $ + $Id: pa_string.C,v 1.162 2002/06/26 10:35:16 paf Exp $ */ #include "pcre.h" @@ -705,6 +705,11 @@ double String::as_double() const { cstr=buf; } else cstr=this->cstr(); + while(*cstr && isspace(*cstr)) + cstr++; + if(!*cstr) + return 0; + char *error_pos; // 0xABC if(cstr[0]=='0') @@ -734,6 +739,11 @@ int String::as_int() const { cstr=buf; } else cstr=this->cstr(); + while(*cstr && isspace(*cstr)) + cstr++; + if(!*cstr) + return 0; + char *error_pos; // 0xABC if(cstr[0]=='0')