wrong logic never found the 'end'
This commit is contained in:
parent
d2c7179cd0
commit
f14fc6b98f
1 changed files with 2 additions and 2 deletions
|
@ -193,7 +193,7 @@ SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
|
||||||
for ( i = 0; i < (int)id.length(); ++i ) {
|
for ( i = 0; i < (int)id.length(); ++i ) {
|
||||||
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
|
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
|
||||||
int c = (int)(idptr[i] - 'A');
|
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 ) {
|
if ( alphabet[c][j] == DIT ) {
|
||||||
length += DIT_SIZE;
|
length += DIT_SIZE;
|
||||||
} else if ( alphabet[c][j] == DAH ) {
|
} 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 ) {
|
for ( i = 0; i < (int)id.length(); ++i ) {
|
||||||
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
|
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
|
||||||
int c = (int)(idptr[i] - 'A');
|
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 ) {
|
if ( alphabet[c][j] == DIT ) {
|
||||||
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
|
memcpy( buf_ptr, dit_ptr, DIT_SIZE );
|
||||||
buf_ptr += DIT_SIZE;
|
buf_ptr += DIT_SIZE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue