From 8e6e0f182b6e1f45bed9d9e5edc27bcd3c01aa89 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 16 Jun 2005 04:31:39 +0000 Subject: [PATCH] fix edit hash values clamp (gcc) or wrap (msvc) when loading scores --- stepmania/src/XmlFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 1ac26a040d..0268afa0f2 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -642,14 +642,14 @@ void XNode::GetValue(CString &out) const { out = m_sValue; } void XNode::GetValue(int &out) const { out = atoi(m_sValue); } void XNode::GetValue(float &out) const { out = strtof(m_sValue, NULL); } void XNode::GetValue(bool &out) const { out = atoi(m_sValue) != 0; } -void XNode::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue); } +void XNode::GetValue(unsigned &out) const { out = 0; sscanf(m_sValue,"%u",&out); } void XNode::GetValue(DateTime &out) const { out.FromString( m_sValue ); } void XAttr::GetValue(CString &out) const { out = m_sValue; } void XAttr::GetValue(int &out) const { out = atoi(m_sValue); } void XAttr::GetValue(float &out) const { out = strtof(m_sValue, NULL); } void XAttr::GetValue(bool &out) const { out = atoi(m_sValue) != 0; } -void XAttr::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue); } +void XAttr::GetValue(unsigned &out) const { out = 0; sscanf(m_sValue,"%u",&out); } void XAttr::GetValue(DateTime &out) const { out.FromString( m_sValue ); } //========================================================