在 2023/11/29 18:38, Antonin Décimo 写道:
Previous code was too complex and hard to understand, and snprintf
fits the job nicely.

Signed-off-by: Antonin Décimo <anto...@tarides.com>
---
  mingw-w64-libraries/winpthreads/src/thread.c | 21 ++++----------------
  1 file changed, 4 insertions(+), 17 deletions(-)


+      char threaderr[sizeof(THREADERR) + 8] = { 0 };
+      snprintf(threaderr, sizeof(threaderr), THREADERR, GetCurrentThreadId());

There wasn't `snprintf()` in MSVCRT.DLL from Windows XP. I think `sprintf()` should be called here, as the length of the output string has an upper limit.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to