Replace sprintf with snprintf in all of Trick source. #1384 (#1392)

* Replace sprintf with snprintf in all of Trick source. #1384

* Don't add -Werror for MacOS because of deprecated sprintf warnings which we cant get rid of because SWIG. #1384

* Fixed an unbalanced parenthesis in S_overrides.mk. #1384
This commit is contained in:
jmpenn
2022-11-15 15:00:05 -06:00
committed by GitHub
parent 265513684a
commit 2a03ff5cf4
72 changed files with 303 additions and 277 deletions

View File

@ -208,7 +208,7 @@ int VariableServerSession::sendErrorMessage(const char* fmt, ... ) {
(void) vsnprintf(errText, MAX_MSG_SIZE, fmt, args);
va_end(args);
sprintf(msgText, "{ \"msg_type\" : \"error\",\n"
snprintf(msgText, sizeof(msgText), "{ \"msg_type\" : \"error\",\n"
" \"error\" : \"%s\"}\n", errText);
mg_websocket_write(connection, MG_WEBSOCKET_OPCODE_TEXT, msgText, strlen(msgText));