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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295675

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