diff --git a/daemon/client.c b/daemon/client.c index 5dd954b19..7d558f526 100644 --- a/daemon/client.c +++ b/daemon/client.c @@ -145,7 +145,7 @@ client_new_sock( const char * path ) gl_proxy = 0; - bzero( &sun, sizeof sun ); + memset( &sun, 0, sizeof sun ); sun.sun_family = AF_LOCAL; strlcpy( sun.sun_path, path, sizeof sun.sun_path ); @@ -901,7 +901,7 @@ infomsg( enum ipc_msg msgid, benc_val_t * list, int64_t tag, return; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.tag = tag; resp = RB_FIND( resptree, &gl_resps, &key ); if( NULL == resp || NULL == resp->infocb ) @@ -953,7 +953,7 @@ statmsg( enum ipc_msg msgid, benc_val_t * list, int64_t tag, return; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.tag = tag; resp = RB_FIND( resptree, &gl_resps, &key ); if( NULL == resp || NULL == resp->statcb ) @@ -1018,7 +1018,7 @@ defmsg( enum ipc_msg msgid, benc_val_t * val, int64_t tag, void * arg UNUSED ) break; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.tag = tag; resp = RB_FIND( resptree, &gl_resps, &key ); if( NULL == resp ) diff --git a/daemon/daemon.c b/daemon/daemon.c index df787766d..6862ee215 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -223,7 +223,7 @@ getlock( const char * path ) return -1; } - bzero( &lk, sizeof lk ); + memset( &lk, 0, sizeof lk ); lk.l_start = 0; lk.l_len = 0; lk.l_type = F_WRLCK; @@ -262,7 +262,7 @@ getsock( const char * path ) return -1; } - bzero( &sun, sizeof sun ); + memset( &sun, 0, sizeof sun ); sun.sun_family = AF_LOCAL; strlcpy( sun.sun_path, path, sizeof sun.sun_path ); unlink( path ); diff --git a/daemon/proxy.c b/daemon/proxy.c index c88d91212..6bfa7e02b 100644 --- a/daemon/proxy.c +++ b/daemon/proxy.c @@ -198,7 +198,7 @@ makesock( enum confpathtype type, const char * path ) struct sockaddr_un sun; int fd; - bzero( &sun, sizeof sun ); + memset( &sun, 0, sizeof sun ); sun.sun_family = AF_LOCAL; if( NULL == path ) { diff --git a/daemon/remote.c b/daemon/remote.c index 3896861a4..612afcb11 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -288,7 +288,7 @@ readargs( int argc, char ** argv, struct opts * opts ) int opt, gotmsg; gotmsg = 0; - bzero( opts, sizeof *opts ); + memset( opts, 0, sizeof *opts ); opts->type = CONF_PATH_TYPE_DAEMON; SLIST_INIT( &opts->files ); opts->map = -1; @@ -492,7 +492,7 @@ hasharg( const char * arg, struct strlist * list, int * all ) } /* try to look up the hash in the hash tree */ - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); strlcpy( key.hash, listitem->str, sizeof key.hash ); treeitem = RB_FIND( torhashes, &gl_hashids, &key ); if( NULL == treeitem ) @@ -622,7 +622,7 @@ infomsg( const struct cl_info * cinfo ) return; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.id = cinfo->id; tinfo = RB_FIND( torlist, &gl_torinfo, &key ); if( NULL == tinfo ) @@ -667,7 +667,7 @@ statmsg( const struct cl_stat * st ) return; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.id = st->id; info = RB_FIND( torlist, &gl_torinfo, &key ); if( NULL == info ) @@ -718,7 +718,7 @@ hashmsg( const struct cl_info * inf ) return; } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); strlcpy( key.hash, inf->hash, sizeof key.hash ); found = RB_FIND( torhashes, &gl_hashids, &key ); if( NULL != found ) @@ -840,7 +840,7 @@ sendidreqs( void ) struct torhash key, * found; ret = -1; - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); for( ii = 0; ARRAYLEN( reqs ) > ii; ii++) { diff --git a/daemon/server.c b/daemon/server.c index 6fa742dcf..1969fa59d 100644 --- a/daemon/server.c +++ b/daemon/server.c @@ -301,7 +301,7 @@ byebye( struct bufferevent * ev, short what, void * arg UNUSED ) } } - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.ev = ev; client = RB_FIND( allclients, &gl_clients, &key ); assert( NULL != client ); diff --git a/daemon/torrents.c b/daemon/torrents.c index a335336ee..c30c9c90e 100644 --- a/daemon/torrents.c +++ b/daemon/torrents.c @@ -278,7 +278,7 @@ torrent_lookup( const uint8_t * hashstr ) assert( NULL != gl_handle ); assert( !gl_exiting ); - bzero( buf, sizeof buf ); + memset( buf, 0, sizeof buf ); for( ii = 0; sizeof( hash ) > ii; ii++ ) { if( !isxdigit( hashstr[2*ii] ) || !isxdigit( hashstr[1+2*ii] ) ) @@ -657,7 +657,7 @@ timerfunc( int fd UNUSED, short event UNUSED, void * arg UNUSED ) if( stillmore ) { - bzero( &tv, sizeof tv ); + memset( &tv, 0, sizeof tv ); tv.tv_sec = TIMER_SECS; tv.tv_usec = TIMER_USECS; evtimer_add( &gl_event, &tv ); @@ -882,7 +882,7 @@ idlookup( int id ) { struct tor key, * found; - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); key.id = id; found = RB_FIND( tortree, &gl_tree, &key ); @@ -894,7 +894,7 @@ hashlookup( const uint8_t * hash ) { struct tor key, * found; - bzero( &key, sizeof key ); + memset( &key, 0, sizeof key ); memcpy( key.hash, hash, sizeof key.hash ); found = RB_FIND( hashtree, &gl_hashes, &key );