Re: [hatari-devel] Patch to fix crash saving midi preferences on Mac

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi Eero,
 
Ok, so that header change in b8b80c4d broke it.
In my haste to get it working last night, I completely missed the fact that the size of the buffer changed in the above commit! Thanks for pointing that out.

Could you change your patch to use sizeof() and strlcpy() like the
commit b8b80c4d6 does (to make it more robust and smaller), test that it
still works, and send it to list / me?

Please see attached a new patch which uses sizeof(<the buffer>) instead of a constant. I also followed Thomas's suggestion and used strlcpy instead of strncpy, which matches the way the SDL GUI does this as well. I've tested on my Mac and it appears to work ok (no crash when saving the config).

How does it look now?

Cheers,
Chris

 


        - Eero


Attachment: 0001-Fix-crash-on-Mac-by-setting-size-of-buffer-correctly.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/