Fix a bug in handling message lengths.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2745 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-16 18:25:27 +00:00
parent 3540547084
commit f347e3755a
2 changed files with 17 additions and 4 deletions

View File

@ -1,9 +1,10 @@
subroutine genjt9(message,msgsent,i4tone)
subroutine genjt9(msg0,msgsent,i4tone)
! Encodes a JT9 message and returns msgsent, the message as it will
! be decoded, and an integer array i4tone(85) of 9-FSK tone values
! in the range 0-8.
character*22 msg0
character*22 message !Message to be generated
character*22 msgsent !Message as it will be received
integer*4 i4Msg6BitWords(13) !72-bit message as 6-bit words
@ -16,7 +17,15 @@ subroutine genjt9(message,msgsent,i4tone)
include 'jt9sync.f90'
save
message=msg0
do i=1,22
if(ichar(message(i:i)).eq.0) then
message(i:)=' '
exit
endif
enddo
do i=1,22 !Omit leading blanks
if(message(1:1).ne.' ') exit
message=message(i+1:)
enddo

View File

@ -1051,15 +1051,19 @@ void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg()
bool eom;
eom=false;
int iz=ba.length();
for(int i=0;i<iz; i++) {
if((int)ba[i] == 0) eom=true;
// qDebug() << ba << iz;
for(int i=0;i<iz+1; i++) {
if((int)ba[i] == 0) {
// qDebug() << i;
eom=true;
}
if(eom) {
message[i]=32;
} else {
message[i]=ba[i];
}
}
message[28]=0;
message[iz]=0;
}
void MainWindow::on_txFirstCheckBox_stateChanged(int nstate) //TxFirst