tr24731

Do you use the TR 24731 'safe' functions in your C code?

The ISO C committee (ISO/IEC JTC1/SC21/WG14) has published TR 24731-1 and is working on TR 24731-2 (the second part is still under development). From the web site: TR 24731-1: Extensions to the C Library Part I: Bounds-checking interfaces WG14 is working on a TR on safer C library functions. This TR is oriented towards modifying exi...

sprintf_s with a buffer too small

The following code causes an error and kills my application. It makes sense as the buffer is only 10 bytes long and the text is 22 bytes long (buffer overflow). char buffer[10]; int length = sprintf_s( buffer, 10, "1234567890.1234567890." ); How do I catch this error so I can report it instead of crashing my application? Edit: ...