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

20010110: nmap "Set Time" problem



Scott and Steve,

I found that under certain platforms, the NMAP and NMAP2 calendar gadget 
for setting the date/time for data produced odd results such as
partial listing for buttons of the month to select.

In nmap_dttmw.c dttmw_monthSet() for both programs, where str is defined as:
char     str[3];


The strings for the dates on the row/column buttons are created using the lines:
                if ( day < 10 )
                    sprintf(str, "%2d", day);
                else
                    sprintf(str, " %d", day);


I believe the above is backwards so that the 2 digit day will not allow for
a NULL terminator in str[2].

The following corrected the problem I was having:

                if ( day > 9 )
                    sprintf(str, "%2d\0", day);
                else
                    sprintf(str, " %d\0", day);


Steve Chiswell
Unidata User Support