]> git.armaanb.net Git - opendoas.git/blob - libopenbsd/explicit_bzero.c
9a646c677832b43736a5fe1a61fbce6ca31f74da
[opendoas.git] / libopenbsd / explicit_bzero.c
1 /*      $OpenBSD: explicit_bzero.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */
2 /*
3  * Public domain.
4  * Written by Matthew Dempsky.
5  */
6
7 #include <string.h>
8
9 #define __UNUSED __attribute__ ((unused))
10
11 __attribute__((weak)) void
12 __explicit_bzero_hook(__UNUSED void *buf, __UNUSED size_t len)
13 {
14 }
15
16 void
17 explicit_bzero(void *buf, size_t len)
18 {
19         memset(buf, 0, len);
20         __explicit_bzero_hook(buf, len);
21 }