libowfat/byte/byte_zero.c

16 lines
361 B
C
Raw Normal View History

2001-02-02 17:54:47 +00:00
#include "byte.h"
2016-04-27 14:07:49 +00:00
#include <string.h>
2001-02-02 17:54:47 +00:00
/* byte_zero sets the bytes out[0], out[1], ..., out[len-1] to 0 */
2006-11-07 17:56:05 +00:00
void byte_zero(void* out, size_t len) {
2016-04-27 14:07:49 +00:00
/* instead of doing this ourselves, defer to the hopefully amazingly
* optimized memset from libc */
memset(out,0,len);
#if 0
register char* s=out;
size_t i;
for (i=0; i<len; ++i)
s[i]=0;
#endif
2001-02-02 17:54:47 +00:00
}