Sam James 2aea3a5ecf
dev-util/unifdef: fix tests w/ _FORTIFY_SOURCE
The unifdef testsuite has been failing sometimes for years with
_FORTIFY_SOURCE in a non-obvious way, where glibc's fgets will return
\0 w/ n=1.

I'd found marxin's PR for this years ago and apparently completely forgot
about it (nor did I backport the patch into Gentoo at the time, as
I didn't maintain it, and I was fairly new then).

Backport marxin's patch from 2022 accordingly. Thanks to Ben Beasley
poking me on the upstream PR (19) which made me look at all of this
again.

Bug: https://gcc.gnu.org/PR120205
Bug: https://github.com/fanf2/unifdef/pull/15
Bug: https://github.com/fanf2/unifdef/pull/19
Closes: https://bugs.gentoo.org/836698
Signed-off-by: Sam James <sam@gentoo.org>
2025-05-10 02:31:28 +01:00
..