Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make SDL error string formatting deal with nasty corner cases.
We continued looping while maxlen > 0, but maxlen was unsigned, so an overflow would make it a large number instead of negative. Fixed. Some snprintf() implementations might return a negative value if there isn't enough space, and we now check for that. Don't overrun the SDL error message buffer, if snprintf() returned the number of chars it wanted to write instead of the number it did. snprintf is a portability mess, we should just never use the C runtime for it. Fixes Bugzilla #2049.
- Loading branch information