From b5553ec6ca03ddc3a7471c4012a71b1dacad2e40 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 23 Nov 2004 11:56:50 +0000 Subject: [PATCH] Corrected small bug in the tokenizer (it would add a fake token for lines ending with a space before /n) --- wrap/io_trimesh/import_off.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/wrap/io_trimesh/import_off.h b/wrap/io_trimesh/import_off.h index aa74060a..f91d3763 100644 --- a/wrap/io_trimesh/import_off.h +++ b/wrap/io_trimesh/import_off.h @@ -19,6 +19,12 @@ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * +****************************************************************************/ +/**************************************************************************** + History + +$Log: not supported by cvs2svn $ + ****************************************************************************/ #ifndef __VCGLIB_IMPORT_OFF @@ -285,11 +291,14 @@ namespace vcg { while (line[from]==' ' && from!=length) from++; - to = from+1; - while (line[to]!=' ' && to!=length) - to++; - tokens.push_back(line.substr(from, to-from).c_str()); - from = to; + if(from!=length) + { + to = from+1; + while (line[to]!=' ' && to!=length) + to++; + tokens.push_back(line.substr(from, to-from).c_str()); + from = to; + } } while (from