dotfiles/_unused/slock/explicit_bzero.c

20 lines
337 B
C
Raw Normal View History

2021-06-19 15:05:17 +02:00
/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */
/*
* Public domain.
* Written by Matthew Dempsky.
*/
#include <string.h>
2022-06-12 11:58:28 +02:00
__attribute__((weak)) void
2021-06-19 15:05:17 +02:00
__explicit_bzero_hook(void *buf, size_t len)
{
}
2022-06-12 11:58:28 +02:00
void
2021-06-19 15:05:17 +02:00
explicit_bzero(void *buf, size_t len)
{
2022-06-12 11:58:28 +02:00
memset(buf, 0, len);
__explicit_bzero_hook(buf, len);
2021-06-19 15:05:17 +02:00
}