Re: [hatari-devel] sprintf deprecated in macOS 13.0

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


Hi,

On 5.11.2022 18.37, Andreas Grabher wrote:
Am 05.11.2022 um 11:38 schrieb Thomas Huth <th.huth@xxxxxxxxx>:
schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
it seems sprintf is deprecated in macOS 13.0. I am getting lots of warnings. They recommend to replace it with snprintf. I think we should do that.

Uh, that will be another big code churn ... but I agree, it's likely a good
idea. Do you maybe want to do the convertion in the DSP code in
Previous? ... then I could port the patch to Hatari.

I appended a patch for the DSP code. It replaces all sprintf() with snprintf(). There are quite a lot left in other parts of the code, but not all are shared between Previous and Hatari.

Thanks!

Otherwise the patch seems fine, but why you're doing these buffer size increases:
-------------------------------------------
-static char str_instr[80];
-static char str_instr2[120];
+static char str_instr[96];
+static char str_instr2[192];
-------------------------------------------
?

These are static buffers, so their sizes are known at compile time i.e. GCC should have already been giving warnings if they would have been too small...


	- Eero



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