Fix naive use of ftell(3).

Secure coding practices, FIO19-C.
This commit is contained in:
pfg 2016-02-16 21:39:19 +00:00
parent bc7ee6c357
commit fae984a570

View File

@ -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)); \
}