Nieb wrote: "So, perhaps the original issue wasn't "can't do negative spaces" but, instead "can't print a string with 4294967295 characters".
Maybe the print() function could use some safety checks on string-length and number-of-calls per-frame."
This is how it will have been.
Since +1 is added to the length when reserving memory, there is an integer overflow and possibly 0xffffff becomes 0x00000000 again.
Thus, 0 bytes would be reserved for the string.
If one then writes into it, there is of course a memory error.
The correct if statement would rather be the following.
if ( length > 0x7fffffff )
{
#ifdef _AGK_ERROR_CHECK
agk::Error ( "Negative valued passed into the Spaces command" );
#endif
return 0;
}
But I also wonder if a string of more than 2 terrabytes should be allowed.
That is just my opinion.