]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: fclose(stdin) UB
authorCristian Rodríguez <crrodriguez@opensuse.org>
Tue, 21 Mar 2023 19:55:15 +0000 (19:55 +0000)
committerCristian Rodríguez <crrodriguez@opensuse.org>
Tue, 21 Mar 2023 19:55:15 +0000 (19:55 +0000)
commite0a12a5fbe7c8bd161baa3e40ad377a226b01254
tree7c72302f8881340683339c6bcec9a3bdb654000e
parentbccae5d85831c4cfa6b5d147acec739bd3c148b9
tests: fclose(stdin) UB

The standard streams must not be closed unless it is
the very last thing a program does before termination.

A warning about this was added to POSIX.1-2008 and later standards.

One must redirect stdin to /dev/null using freopen instead.
tests/helpers/test_md5.c
tests/helpers/test_sha1.c