Changeset 7284 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Apr 13, 2006, 8:52:41 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/multi_type.cc
r7221 r7284 296 296 else if (this->type & MT_STRING) 297 297 { 298 if (this->storedString == "") return 0; 299 char* endPtr = NULL; 300 int result = strtol(this->storedString.c_str(), &endPtr, 10); 301 if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + strlen(this->storedString.c_str())) 302 return 0; 303 else 304 return result; 298 std::stringstream ssStream(this->storedString); 299 int iReturn; 300 ssStream >> iReturn; 301 return iReturn; 305 302 } 306 303 return 0; … … 323 320 char* endPtr = NULL; 324 321 double result = strtod(this->storedString.c_str(), &endPtr); 325 if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + strlen(this->storedString.c_str()))322 if ( endPtr >= this->storedString.c_str() && endPtr < this->storedString.c_str() + this->storedString.size()) 326 323 return 0.0f; 327 324 else
Note: See TracChangeset
for help on using the changeset viewer.