...
By using the invalid()
function defined above, the function is less likely to modify memory outside its bounds (see ERR06-A. Understand the termination behavior of assert() and abort()).
Code Block | ||
---|---|---|
| ||
void incr(int *intptr) { if (invalid( intptr)) { /* handle error */ } *intptr++; } |
...