Fix naive use of ftell(3).
Secure coding practices, FIO19-C.
This commit is contained in:
parent
a721585d27
commit
0bfdca975c
@ -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)); \
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user