1
0
Fork 0

wrong logic never found the 'end'

This commit is contained in:
torsten 2010-01-02 20:51:32 +00:00 committed by Tim Moore
parent d2c7179cd0
commit f14fc6b98f

View file

@ -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;