bzero -> memset

This commit is contained in:
Josh Elsasser 2007-07-19 00:57:26 +00:00
parent c10e7c3288
commit 65dba27217
6 changed files with 18 additions and 18 deletions

View File

@ -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 )

View File

@ -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 );

View File

@ -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 )
{

View File

@ -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++)
{

View File

@ -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 );

View File

@ -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 );