logo separator

[mkgmap-dev] missing check for option --family-id

From Ticker Berkin rwb-mkgmap at jagit.co.uk on Tue Apr 7 13:02:39 BST 2020

Hi Gerd

In the short term, warn if value < 0 or > 32767.

In the longer term, the methods in io/Structured{Input/Output}Stream
should be brought into line with the naming conventions in
imgfmt/app/*File{Reader/Writer} and the calls changed; the only
references are in imgfmt/mps and tdbfmt

Then tdb should be changed to consider this unsigned, store the vals as
an int, read/write with unsigned methods and change the warning range.

I'm happy to do the second set of changes sometime.

Ticker


On Tue, 2020-04-07 at 10:08 +0000, Gerd Petermann wrote:
> Hi all,
> in the garmin forum there is a discussion about the range :
> https://forum.openstreetmap.org/viewtopic.php?pid=782395#p782395
> 
> The current options.txt says 
> --family-id=integer
>     This is an integer that identifies a family of products. Range:
> [1..9999]
>     Default: 6324 
> 
> This limit is neither checked nor is it correct. The corresponding
> value is stored in a two byte field and most mkgmap sources interpret
> it as a 16-bit-unsigned integer.
> However, in class uk.me.parabola.tdbfmt.HeaderBlock the field is
> stored in a short (signed 16-bit-int). 
> 
> My conclusion: We should print a warning when the value given in -
> -family-id is < 0 or > 32767.
> 
> Gerd
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list