[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20050908: nmap2 model SPF bug



Chuck,

I am able to duplicate your problemm, and will pass your message on to
the developers of NMAP2.

Thanks,

Steve Chiswell
Unidata User Support





>From: "Dr. Charles Graves" <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200509081926.j88JQOjo004792

>I have found an apparent bug in nmap2 when using user-generated
>restore (*.spf) files that use gridded data. 
>
>----
>
>Demonstration of the error:
>
>After firing up nmap2, load the latest model (all models I have tried
>fail) and display one of the fields (which one doesn't matter). 
>The procedure is saved as a restore script (via Save Data Settings).  
>If you now go back and try to load that restore file (via Restore 
>Data Settings), it will fail, producing a...
>
>"No valid data sources found in xxx.spf"
>
>----
>
>The bug appears to be in the file:
>
>$NAWIPS/gempak/source/programs/gui/nmap2/nmap_spfw.c
>
>My fix is the following:
>
>Line 2134 in that file I have changed to:
>
>             (int)strlen( moslst ) >= (noc2 + 12) ) {
>
>From
>             (int)strlen( moslst ) > (noc2 + 12) ) {
>
>by making the comparison "greater or equal to".
>
>The variable moslst contains the list of times separated by ";" for example:
>
>moslst=050906/1200;050907/0000;050907/1200;050908/0000;050908/1200 
>
>noc2=47 (location of the last ";" counting from zero )
>
>(int)strlen( moslst )=59
>
>adding the 12 (as done in the comparison) equals the number of characters
>in moslst and therefore the comparison fails (it is not greater than the
>length of the string).
>
>This should be reviewed and check with people in the know...
>you should not trust my logic (or lack there of).
>
>Chuck
>
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.