[10:16:28] exultbridge:Dominus: @Marzo new xcode is complaining about sprintf usage "sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead." AFAICT from briefly looking at it, it's a "false" warning as (If I understand correctly) the security concern is when sprintf is not limited in size, but we always limit it.
[10:16:28] Correct? Example https://github.com/exult/exult/blob/master/actors.cc#L4021
[10:21:12] sh4: turn that to sprintf(hpmsg, sizeof(hpmsg), "-%d(%d)", delta, oldhp - delta);
[10:22:45] exultbridge:Dominus: sNprintf(hpmsg, sizeof(hpmsg), "-%d(%d)", delta, oldhp - delta); right? And thanks, I already saw how to fix the warning but I didn't want to do it without consulting Marzo first.
[10:23:12] sh4: but yeah, the warning is sorta bogus here since %d prints a 32 bit int as decimal which has a maximum value of 4294967295 (as unsigned) so max 10 chars
[10:23:28] sh4: oh, right sNprintf, copy/paste error
[10:24:14] exultbridge:Dominus: it's in 5 places in our code (one is vsprintf)
[10:25:07] exultbridge:Marzo: @Dominus To be fair, I am thinking of getting rid of all s?n?printf calls, as well as cout/cerr usage, and replace it all with a combination of fmt and spdlog (https://github.com/fmtlib/fmt, https://github.com/gabime/spdlog)
[10:25:53] exultbridge:Marzo: But yeah, just swapping to snprintf and adding the size is the proper way to handle those warnings
[10:26:15] exultbridge:Dominus: I was figuring you would say something like that 🙂 (replacing with something else)
[10:26:20] exultbridge:Dominus: should I go ahead?
[10:26:27] exultbridge:Marzo: Sure