Fix naive use of ftell(3).

Secure coding practices, FIO19-C.
This commit is contained in:
Pedro F. Giffuni 2016-02-16 21:39:19 +00:00
parent a721585d27
commit 0bfdca975c

View File

@ -270,5 +270,5 @@ struct ignoretab {
*/ */
#define trunc(stream) { \ #define trunc(stream) { \
(void)fflush(stream); \ (void)fflush(stream); \
(void)ftruncate(fileno(stream), (off_t)ftell(stream)); \ (void)ftruncate(fileno(stream), ftello(stream)); \
} }