In this case (JTMSK and MSK144 modes only) we could use 
msg0.trimmed().length().

But other modes (e.g., JT4) have end-of-line flags that we don't want 
included in what gets passed to processMessage().  I think that's where 
the fixed-length usage came from.

As you say, not a big deal.  (Like a lot of things in WSJT-X, it could 
no doubt be done in a cleaner way.)

        -- Joe

On 8/16/2016 3:29 PM, Black Michael wrote:
> Hmmm....I thought length() was the true length of the string. No big deal.
> Since this wasn't future-proofed before do you want to consider an error
> check before the call to ensure it's NOT longer than 43?
>
> Not that WSJT-X ever changes...:-)
>
> de Mike W9MDB
>
> ------------------------------------------------------------------------
> *From:* Joe Taylor <j...@princeton.edu>
> *To:* WSJT software development <wsjt-devel@lists.sourceforge.net>
> *Sent:* Tuesday, August 16, 2016 2:21 PM
> *Subject:* Re: [wsjt-devel] Grid square last digit being cut off in msk144
>
> Hi Mike,
>
> Thanks for the bug fix. In the end I changed "40" to "43", to allow for
> a max-length message like this:
>
> 131415 -4 11.2 1501 & <KA9CFD WB4JWM> R+00
>
> Using msg0.length() would make it always use length=80, causing a minor
> waste of space downstream.
>
> -- Joe, K1JT
>
> On 8/16/2016 3:02 PM, Black Michael wrote:
>  > Sending again in text mode...
>  >
>  >
>  >
>  >
>  > Here's a fix....the string was 41 chars long.
>  > Though I wonder if instead of just increasing the arg to "41" it should
>  > be "msg0.length()" instead so I'm proposing that as the fix.
>  >
>  > de Mike W9MDB
>  >
>  > Index: mainwindow.cpp
>  > ===================================================================
>  > --- mainwindow.cpp (revision 7032)
>  > +++ mainwindow.cpp (working copy)
>  > @@ -2255,7 +2255,7 @@
>  > int i2=msg0.indexOf(m_hisCall);
>  > if((m_mode=="JTMSK" or m_mode=="MSK144" or m_bFast9) and m_bEME and
>  > tmax>=0.0 and
>  > i1>10 and i2>i1+3) { //Here, "m_bEME" implies AutoSeq
>  > - if((msg0.indexOf(" 73") < 0) or (m_ntx!=6))
> processMessage(msg0,40,false);
>  > + if((msg0.indexOf(" 73") < 0) or (m_ntx!=6))
>  > processMessage(msg0,msg0.length(),false);
>  > }
>  > if(m_msg[i][0]==0) break;
>  > QString message=QString::fromLatin1(m_msg[i]);
>
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
> ------------------------------------------------------------------------------
>  >
>  >
>  >
>  > _______________________________________________
>  > wsjt-devel mailing list
>  > wsjt-devel@lists.sourceforge.net
> <mailto:wsjt-devel@lists.sourceforge.net>
>  > https://lists.sourceforge.net/lists/listinfo/wsjt-devel
>
> ------------------------------------------------------------------------------
> _______________________________________________
> wsjt-devel mailing list
> wsjt-devel@lists.sourceforge.net <mailto:wsjt-devel@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/wsjt-devel
>
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> wsjt-devel mailing list
> wsjt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wsjt-devel

------------------------------------------------------------------------------
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to