Fix naive use of ftell(3).
Secure coding practices, FIO19-C.
This commit is contained in:
parent
bc7ee6c357
commit
fae984a570
@ -270,5 +270,5 @@ struct ignoretab {
|
||||
*/
|
||||
#define trunc(stream) { \
|
||||
(void)fflush(stream); \
|
||||
(void)ftruncate(fileno(stream), (off_t)ftell(stream)); \
|
||||
(void)ftruncate(fileno(stream), ftello(stream)); \
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user