From 237705ea578acf0d56d0383bba4d2deb4e9c7c95 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 29 Aug 2004 05:01:46 +0000 Subject: [PATCH] cap length of Steps m_sDescription to a reasonable value --- stepmania/src/Steps.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 9d47216857..c6e732198d 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -31,6 +31,8 @@ #include "PrefsManager.h" #include "NotesLoaderSM.h" +const int MAX_DESCRIPTION_LENGTH = 20; + Steps::Steps() { m_StepsType = STEPS_TYPE_INVALID; @@ -155,6 +157,9 @@ void Steps::TidyUpData() if( GetMeter() < 1) // meter is invalid SetMeter( int(PredictMeter()) ); + + if( m_sDescription.size() > MAX_DESCRIPTION_LENGTH ) + m_sDescription = m_sDescription.Left( MAX_DESCRIPTION_LENGTH ); } void Steps::Decompress() const