TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  7.19.gChecked automatically with code checker

Synopsis:Do not use the same buffer for reading and writing when calling input/output functions.
Language:C
Severity Level:1
Category:Library


Description:

Justification

If the same buffer is used the behavior is undefined.

Example

result = snprintf(mystring, STR_SIZE, "%s\n", mystring); /* WRONG */
result = snprintf(mynewstring, STR_SIZE, "%s\n", mystring); /* RIGHT */