Update length after shortening string (thanks mayraud705!) Closes https://github.com/libsdl-org/SDL/pull/4698