The explicit_bzero function is a common extension, but memset_explicit
was standardized in C23. It will likely become more portable in the
future, and Gnulib provides an implementation if needed.
* bootstrap.conf (gnulib_modules): Add memset_explicit. Remove
explicit_bzero.
* gl/lib/randint.c (randint_free): Use memset_explicit instead of
explicit_bzero.
* gl/lib/randread.c (randread_free_body): Likewise.
euidaccess
exclude
exitfail
- explicit_bzero
faccessat
fadvise
fchdir
memcmp2
mempcpy
memrchr
+ memset_explicit
minmax
mkancesdirs
mkdir
void
randint_free (struct randint_source *s)
{
- explicit_bzero (s, sizeof *s);
+ memset_explicit (s, 0, sizeof *s);
free (s);
}
randread_free_body (struct randread_source *s)
{
FILE *source = s->source;
- explicit_bzero (s, sizeof *s);
+ memset_explicit (s, 0, sizeof *s);
free (s);
return source ? fclose (source) : 0;
}