From 1feff591904487e9590a4ab271b69c567bf53c30 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Thu, 8 Jul 2004 18:07:51 +0000 Subject: [PATCH] Fixed an error that I recently introduced in using size_types. --- Cantera/src/stringUtils.cpp | 6 +++--- Cantera/src/units.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cantera/src/stringUtils.cpp b/Cantera/src/stringUtils.cpp index 76b424a23..ef1ea9375 100755 --- a/Cantera/src/stringUtils.cpp +++ b/Cantera/src/stringUtils.cpp @@ -86,14 +86,14 @@ namespace Cantera { string name, num, nm; do { ibegin = s.find_first_not_of(", ;\n\t"); - if (ibegin != string::npos) { + if (ibegin != string::npos) { s = s.substr(ibegin,s.size()); icolon = s.find(':'); iend = s.find_first_of(", ;\n\t"); //icomma = s.find(','); - if (icolon > 0) { + if (icolon != string::npos) { name = s.substr(0, icolon); - if (iend > 0) { + if (iend != string::npos) { num = s.substr(icolon+1, iend-icolon); s = s.substr(iend+1, s.size()); } diff --git a/Cantera/src/units.h b/Cantera/src/units.h index c86d981d4..08f1c8aae 100644 --- a/Cantera/src/units.h +++ b/Cantera/src/units.h @@ -106,7 +106,7 @@ namespace Cantera { throw CanteraError("toSI","unknown unit: "+tsub); if (action == '-') f *= fctr; else if (action == '/') f /= fctr; - if (k < 0) break; + if (k == string::npos) break; action = u[k]; u = u.substr(k+1,u.size()); }