always use memset instead of bzero

This commit is contained in:
david parsons
2018-02-28 09:44:40 -08:00
parent 35aa1494b3
commit 67786b3e27
2 changed files with 2 additions and 9 deletions
+1 -7
View File
@@ -153,13 +153,7 @@ else
AC_DEFINE 'INITRNG(x)' '(void)1'
fi
if AC_CHECK_FUNCS 'bzero((char*)0,0)'; then
: # Yay
elif AC_CHECK_FUNCS 'memset((char*)0,0,0)'; then
AC_DEFINE 'bzero(p,s)' 'memset(p,s,0)'
else
AC_FAIL "$TARGET requires bzero or memset"
fi
AC_CHECK_FUNCS 'memset((char*)0,0,0)' || AC_FAIL "$TARGET requires memset"
if AC_CHECK_FUNCS random; then
AC_DEFINE 'COINTOSS()' '(random()&1)'
+1 -2
View File
@@ -7,7 +7,6 @@
#include <string.h>
#include "gethopt.h"
#include "config.h" /* for bzero() macro on systems that don't have it */
void
@@ -16,7 +15,7 @@ struct h_context *ctx;
int argc;
char **argv;
{
bzero(ctx, sizeof *ctx);
memset(ctx, 0, sizeof *ctx);
ctx->argc = argc;
ctx->argv = argv;
ctx->optind = 1;