From c2c3e00e3187daad60c2008a692c4c272d654cd8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 23 Apr 2005 11:06:28 +0000 Subject: [PATCH] don't assert on valid return values from strcmp (fix crash in Linux) --- stepmania/src/NoteDisplay.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index c57dc76d2d..a92a6381b2 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -101,13 +101,13 @@ struct NoteSkinAndPath CString sPath; bool operator<( const NoteSkinAndPath &other ) const { - switch( strcmp(sNoteSkin, other.sNoteSkin) ) - { - case -1: return true; - case 0: return sPath < other.sPath; - case 1: return false; - default: ASSERT(0); return false; - } + int cmp = strcmp(sNoteSkin, other.sNoteSkin); + if( cmp < 0 ) + return true; + else if( cmp == 0 ) + return sPath < other.sPath; + else + return false; } };