nesbox / TIC-80

TIC-80 is a fantasy computer for making, playing and sharing tiny games.
https://tic80.com
MIT License
4.84k stars 462 forks source link

fix horribly broken command line parsing #2578

Closed Gargaj closed 1 month ago

Gargaj commented 1 month ago

The version of argparse you're pinned to wants int-s when ARGPARSE_OPT_BOOLEAN is used: https://github.com/cofyc/argparse/blob/0d5f5d0745df14a3f373f7eed85bf524714f4524/argparse.c#L57-L66 but you're using bool-s: https://github.com/nesbox/TIC-80/blob/main/src/studio/studio.h#L71-L81 If there's a size-mismatch between bool and int (depending on compiler, platform, etc etc), then whatever garbage may be in the padding gets treated as part of the int - I suspect this is why command line fullscreen hasn't worked for a loooooong time now.