Login Page - Create Account

Support Board


Date/Time: Sun, 19 Jan 2025 03:12:06 +0000



Post From: Format function crashes SC

[2018-03-13 02:02:07]
User44130 - Posts: 23
Using the below piece of code causes SC to shutdown (accidentally omitting "f" or other format letter after "%") as a result of buffer overflow. Couldn't locate this error for a long time as it's hidden from compiler in SC proprietary function. First time see this type of fault causing SC to close. Building error handling code for this function might be a good idea as it is must be used pretty frequently.

SCString MsgLog;

MsgLog.Format("Max Size Limit! CurrBSAv: % BSAvLmt: %f BSMax: %d ", CurrBSAv, BSAvLmt, BSMax);
sc.AddMessageToLog(MsgLog,0);