...
Compliant Solution
Code Block | ||
---|---|---|
| ||
(none known)FILE* fptr = fopen(file_name, "rb"); fpos_t pos; if (fptr == NULL) { /* handle error condition */ } if(fgetpos(fptr, &pos)) { /* Handle Error */ } /* Read data */ if(fsetpos(fptr, &pos)) { /* Handle Error */ } /* Continue on */ |
Risk Assessment
If used improperly, ungetc()
can cause data to be truncated or lost.
...