File: byte_zero.c

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (15 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "byte.h"
#include <string.h>

/* byte_zero sets the bytes out[0], out[1], ..., out[len-1] to 0 */
void byte_zero(void* out, size_t len) {
  /* 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
}