minetest / minetestmapper

Generates a overview image of a minetest map.
BSD 2-Clause "Simplified" License
112 stars 40 forks source link

Fix crash on unknown option #32

Closed Nestorfish closed 8 years ago

Nestorfish commented 8 years ago

getopts requires the last element of longopts to be filled with zeros. Fixes possible segfault in case of unknown long option

sfan5 commented 8 years ago

Doesn't seem to happen here: ./minetestmapper: unrecognized option '--foobar'

merging still seems useful, thanks ¯\_(ツ)_/¯

Nestorfish commented 8 years ago

I had a doubt too, but it depends of build (zeros may be present just after this array in memory during execution). In my case, it happens when it is built from main directory, but it doesn't when built from a "build" dir... I will not explain this :-)