Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRAgostinho authored and Sérgio Agostinho committed Nov 20, 2015
1 parent 25da939 commit f9de135
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion io/include/pcl/io/ply/ply_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,16 @@ inline bool pcl::io::ply::ply_parser::parse_scalar_property (format_type format,
typedef ScalarType scalar_type;
if (format == ascii_format)
{
std::string value_s;
scalar_type value = std::numeric_limits<scalar_type>::quiet_NaN ();
char space = ' ';
istream >> value;
istream >> value_s;
try
{
value = boost::lexical_cast<scalar_type> (value_s);
}
catch (boost::bad_lexical_cast &) {}

if (!istream.eof ())
istream >> space >> std::ws;
if (!istream || !isspace (space))
Expand Down

0 comments on commit f9de135

Please sign in to comment.