From f347e3755a969481c742ced5e0cd37ed1bc49572 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Nov 2012 18:25:27 +0000 Subject: [PATCH] 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 --- lib/genjt9.f90 | 11 ++++++++++- mainwindow.cpp | 10 +++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/genjt9.f90 b/lib/genjt9.f90 index 8ef9269c0..4a3770d17 100644 --- a/lib/genjt9.f90 +++ b/lib/genjt9.f90 @@ -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 diff --git a/mainwindow.cpp b/mainwindow.cpp index 99a204f00..0e13f8fc6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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