hessu / perl-aprs-fap

Ham::APRS::FAP – Finnish APRS Parser
Other
12 stars 4 forks source link

make_position() can return minute value 60 in normal format position #7

Closed oh2kku closed 4 years ago

oh2kku commented 4 years ago

make_position() in FAP version 1.21 fails with locations where the degree value is just below an integer amount of degrees. This seems to be due to the sprintf() calls rounding 59.99999... up to 60. Minute value 60 is not valid in a geographic position, so this special case needs to be caught.

Example:

$ perl -e 'use Ham::APRS::FAP qw(make_position); print make_position(20.999999,10.999999,-1,-1,30,"//")'

Got result: !2060.00N/01060.00E//A=000098

Expected result: !2059.99N/01059.99E//A=000098

This probably also affects the !DAO! format position, but not the compressed format position.

hessu commented 4 years ago

Thank you, good fix!