From f14fc6b98f58592303212c5440dabf04d7fd130e Mon Sep 17 00:00:00 2001 From: torsten Date: Sat, 2 Jan 2010 20:51:32 +0000 Subject: [PATCH] wrong logic never found the 'end' --- src/Sound/morse.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sound/morse.cxx b/src/Sound/morse.cxx index 942b637a5..df6c969fa 100644 --- a/src/Sound/morse.cxx +++ b/src/Sound/morse.cxx @@ -193,7 +193,7 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) { for ( i = 0; i < (int)id.length(); ++i ) { if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) { int c = (int)(idptr[i] - 'A'); - for ( j = 0; j < 4 || alphabet[c][j] == end; ++j ) { + for ( j = 0; j < 4 && alphabet[c][j] != end; ++j ) { if ( alphabet[c][j] == DIT ) { length += DIT_SIZE; } else if ( alphabet[c][j] == DAH ) { @@ -227,7 +227,7 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) { for ( i = 0; i < (int)id.length(); ++i ) { if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) { int c = (int)(idptr[i] - 'A'); - for ( j = 0; j < 4 || alphabet[c][j] == end; ++j ) { + for ( j = 0; j < 4 && alphabet[c][j] != end; ++j ) { if ( alphabet[c][j] == DIT ) { memcpy( buf_ptr, dit_ptr, DIT_SIZE ); buf_ptr += DIT_SIZE;