Skip to content

Commit

Permalink
+ don't expect we _must_ consume all input when parsing numbers
Browse files Browse the repository at this point in the history
  some DBF can have some junk appended to records mapnik#1605
  • Loading branch information
artemp authored and PetrDlouhy committed Aug 21, 2013
1 parent 045c287 commit cec1835
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/input/shape/dbfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,15 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f)
double val = 0.0;
const char *itr = record_+fields_[col].offset_;
const char *end = itr + fields_[col].length_;
bool r = qi::phrase_parse(itr,end,double_,ascii::space,val);
if (r && (itr == end))
if (qi::phrase_parse(itr,end,double_,ascii::space,val))
f.put(name,val);
}
else
{
int val = 0;
const char *itr = record_+fields_[col].offset_;
const char *end = itr + fields_[col].length_;
bool r = qi::phrase_parse(itr,end,int_,ascii::space,val);
if (r && (itr == end))
if (qi::phrase_parse(itr,end,int_,ascii::space,val))
f.put(name,val);
}
break;
Expand Down

0 comments on commit cec1835

Please sign in to comment.