deater / dos33fsprogs

Tools for manipulating Apple II dos33 filesystems
http://www.deater.net/weave/vmwprod/apple/dos33fs.html
Other
142 stars 23 forks source link

Initialize path string variables. #19

Open micahcowan opened 2 years ago

micahcowan commented 2 years ago

These string variables were being used uninitialized, causing me to get spurious errors due to random garbage, like:

$ prodos -t BIN -a 0x6000 VIMODE-PRODOS.dsk SAVE VIMODE
Error!   not found!
Error, couldn't open directory (null)
$ prodos -t BIN -a 0x6000 VIMODE-PRODOS.dsk SAVE VIMODE
Error!  9 not found!
Error, couldn't open directory (null)
$ prodos -t BIN -a 0x6000 VIMODE-PRODOS.dsk SAVE VIMODE
Error!  @ not found!
Error, couldn't open directory (null)
$

Et cetera. Adding {} initializers resolved the issue for me (and allowed the above command to complete successfully).

I experienced this issue on Mac OS. I did not experience this on Ubuntu, either because I was lucky, or more likely the memory was already cleared to zero before main() is entered.