You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically, all the text printing script functions have a limit of resulting string. It was an arbitrary 3000 bytes around 3.6.0, in current master it's 2048, but that's not the point. Because AGS Strings may contain up to INT32_MAX bytes, there should not be any restriction on a length of a string that a user may create using e.g. String.Format.
Printing script args is done using ScriptSprintf function. I propose to fix this function to make it act in compliance with standard snprintf: that is let pass a null buffer in which case it would only calculate and return necessary size. Formatting will be done in two steps: first calculate the necessary buffer length, then allocate a StringBuffer, print text, and create ScriptString, or use this text elsewhere as necessary.
The text was updated successfully, but these errors were encountered:
Beyond the tests, I can't figure how this actually get called in String.Format, and don't know how to modify to take the null buffer, but maybe my initial sketch is useful?
Historically, all the text printing script functions have a limit of resulting string. It was an arbitrary 3000 bytes around 3.6.0, in current master it's 2048, but that's not the point. Because AGS Strings may contain up to INT32_MAX bytes, there should not be any restriction on a length of a string that a user may create using e.g. String.Format.
Printing script args is done using ScriptSprintf function. I propose to fix this function to make it act in compliance with standard snprintf: that is let pass a null buffer in which case it would only calculate and return necessary size. Formatting will be done in two steps: first calculate the necessary buffer length, then allocate a StringBuffer, print text, and create ScriptString, or use this text elsewhere as necessary.
The text was updated successfully, but these errors were encountered: