From: serassio <> Date: Sat, 16 Sep 2006 02:49:49 +0000 (+0000) Subject: Portability fix: use memset() instead of deprecated bzero() X-Git-Tag: SQUID_3_0_PRE5~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a302ad3c12422a15b06b587fe804ff5fd0b3b8ae;p=thirdparty%2Fsquid.git Portability fix: use memset() instead of deprecated bzero() --- diff --git a/src/wccp2.cc b/src/wccp2.cc index c845d490fd..5b9c5054eb 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp2.cc,v 1.7 2006/08/20 19:15:32 serassio Exp $ + * $Id: wccp2.cc,v 1.8 2006/09/15 20:49:49 serassio Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Steven Wilton @@ -428,7 +428,7 @@ wccp2_add_service_list(int service, int service_id, int service_priority, wccp2_update_service(wccp2_service_list_ptr, service, service_id, service_priority, service_proto, service_flags, ports); wccp2_service_list_ptr->wccp2_security_type = security_type; - bzero(wccp2_service_list_ptr->wccp_password, WCCP2_PASSWORD_LEN + 1); + memset(wccp2_service_list_ptr->wccp_password, 0, WCCP2_PASSWORD_LEN + 1); strncpy(wccp2_service_list_ptr->wccp_password, password, WCCP2_PASSWORD_LEN); /* add to linked list - XXX this should use the Squid dlink* routines! */ wccp2_service_list_ptr->next = wccp2_service_list_head; @@ -472,7 +472,7 @@ wccp2_update_md5_security(char *password, char *ptr, char *packet, int len) debug(80, 5) ("wccp2_update_md5_security: called\n"); /* The password field, for the MD5 hash, needs to be 8 bytes and NUL padded. */ - bzero(pwd, sizeof(pwd)); + memset(pwd, 0, sizeof(pwd)); strncpy(pwd, password, sizeof(pwd)); ws = (struct wccp2_security_md5_t *) ptr; @@ -491,7 +491,7 @@ wccp2_update_md5_security(char *password, char *ptr, char *packet, int len) * area should be zero'ed before calculating the MD5 hash. */ /* XXX eventually we should be able to kill md5_digest and blit it directly in */ - bzero(ws->security_implementation, sizeof(ws->security_implementation)); + memset(ws->security_implementation, 0, sizeof(ws->security_implementation)); MD5Init(&M); @@ -543,14 +543,14 @@ wccp2_check_security(struct wccp2_service_list_t *srv, char *security, char *pac /* If execution makes it here then we have an MD5 security */ /* The password field, for the MD5 hash, needs to be 8 bytes and NUL padded. */ - bzero(pwd, sizeof(pwd)); + memset(pwd, 0, sizeof(pwd)); strncpy(pwd, srv->wccp_password, sizeof(pwd)); /* Take a copy of the challenge: we need to NUL it before comparing */ memcpy(md5_challenge, ws->security_implementation, 16); - bzero(ws->security_implementation, sizeof(ws->security_implementation)); + memset(ws->security_implementation, 0, sizeof(ws->security_implementation)); MD5Init(&M); @@ -1813,7 +1813,7 @@ parse_wccp2_service_info(void *v) } debug(80, 5) ("parse_wccp2_service_info: called\n"); - bzero(portlist, sizeof(portlist)); + memset(portlist, 0, sizeof(portlist)); /* First argument: id */ service_id = GetInteger();