Fix a libiberty testsuite failure.
[deliverable/binutils-gdb.git] / libiberty / bzero.c
index d01644b7f4b8a4ed1317490d6531d97a5225c70b..44ad73da4d6e956cd012fc4de3ddc32b8a37f1ec 100644 (file)
@@ -2,30 +2,22 @@
    This function is in the public domain.  */
 
 /*
-NAME
-       bzero -- zero the contents of a specified memory region
 
-SYNOPSIS
-       void bzero (char *to, int count)
+@deftypefn Supplemental void bzero (char *@var{mem}, int @var{count})
 
-DESCRIPTION
-       Zero COUNT bytes of memory pointed to by TO.
+Zeros @var{count} bytes starting at @var{mem}.  Use of this function
+is deprecated in favor of @code{memset}.
 
-BUGS
-       Significant speed enhancements may be made in some environments
-       by zeroing more than a single byte at a time, or by unrolling the
-       loop.
+@end deftypefn
 
 */
 
+#include <stddef.h>
+
+extern void *memset(void *, int, size_t);
 
 void
-bzero (to, count)
-  char *to;
-  int count;
+bzero (void *to, size_t count)
 {
-  while (count-- > 0)
-    {
-      *to++ = 0;
-    }
+  memset (to, 0, count);
 }
This page took 0.023175 seconds and 4 git commands to generate.