|Re: [hatari-devel] Patch to fix crash saving midi preferences on Mac|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Patch to fix crash saving midi preferences on Mac
- From: Chris Jenkins <cdpjenkins@xxxxxxxxx>
- Date: Sat, 28 May 2022 18:38:32 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=csRsnv6itoDVTYlmg6YBuU2Cwrc5tNuVi+6m1NqyGB8=; b=S0UfBdjtHBkFzZiUgBVU/0vw0yqGq4T4RVhEtc+kBKzupzQH/I3MKjfZjZcN51bm4C PoMrAAbPPNGYGSG4wFtrQtUYs/tOmn046ik6rVo3guEBHl4CoTxhjk83HlFlqd/SokAF c/55dVgFRfPcY/x2J8vbr67Z1o/exLvJrxZDND7qJGt3PcVXOl5hikd5DvGk+kVLOlHb z6Qa6JIBTmkHLoGxjnpIfiDFj9x8traMsz80Y6q6E9yaJRun/fJuSjbFQ9mbekPe6ZKA 1xecDw74Sckay717JKMadZHUC6NsxFuTXSBSZupgnXVSW4rwJlcw3Zcly590OCk/K4VJ P9ng==
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?
Description: Binary data