What’s wrong with sprintf anyways?

sprintf is unsafe because it doesn’t check the length of the destination buffer. This can cause the function to overflow the destination buffer when the result of the format string is unexpectedly long, leading to security issues and application instability.

snprintf and sprintf_s are safe alternatives to sprintf

1 response to What’s wrong with sprintf anyways?


  1. Daniel Liu

    A new student here, just hanging around, and notice your warning of sprintf.

Leave a Reply

Your email address will not be published. Required fields are marked *