From 25ef8f61d7f97e01e54a03a700184fd545646675 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 28 Sep 2009 00:13:01 +0000 Subject: [PATCH] fixed infinite loop in loadPhy() git-svn-id: svn://anubis/misc/OdeWorld@148 bd8a9e45-a331-0410-811e-c64571078777 --- OdeWorld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OdeWorld.cc b/OdeWorld.cc index b0ebeaa..f5460ed 100644 --- a/OdeWorld.cc +++ b/OdeWorld.cc @@ -116,9 +116,10 @@ vector OdeWorld::loadPhy(const std::string & path, string n = line.substr(pos, pos2 - pos); float f = atof(n.c_str()); args.push_back(f); + if (pos2 == string::npos) + break; pos = pos2 + 1; } - cerr << "Found a '" << type << "' of name '" << name << "' with " << args.size() << " args" << endl; } }