mirror of
https://git.wownero.com/wownero/wownero-puddle.git
synced 2024-08-15 01:03:20 +00:00
tidy memset
This commit is contained in:
parent
0ae2946486
commit
c9346f4a3d
1 changed files with 3 additions and 2 deletions
|
@ -1865,7 +1865,6 @@ send_payments(void)
|
||||||
size_t payments_max_count = 25;
|
size_t payments_max_count = 25;
|
||||||
size_t payments_size = payments_max_count * sizeof(payment_t);
|
size_t payments_size = payments_max_count * sizeof(payment_t);
|
||||||
payment_t *payments = (payment_t*) calloc(1, payments_size);
|
payment_t *payments = (payment_t*) calloc(1, payments_size);
|
||||||
memset(payments, 0, payments_size);
|
|
||||||
payment_t *payment = payments;
|
payment_t *payment = payments;
|
||||||
payment_t *end_payment = payment + payments_max_count;
|
payment_t *end_payment = payment + payments_max_count;
|
||||||
|
|
||||||
|
@ -1995,9 +1994,11 @@ client_add(int fd, struct bufferevent *bev)
|
||||||
pool_clients.count);
|
pool_clients.count);
|
||||||
pool_clients.clients = c;
|
pool_clients.clients = c;
|
||||||
c += pool_clients.count - POOL_CLIENTS_GROW;
|
c += pool_clients.count - POOL_CLIENTS_GROW;
|
||||||
|
memset(c, 0, sizeof(client_t) * POOL_CLIENTS_GROW);
|
||||||
pthread_mutex_unlock(&mutex_clients);
|
pthread_mutex_unlock(&mutex_clients);
|
||||||
log_debug("Client pool can now hold %zu clients", pool_clients.count);
|
log_debug("Client pool can now hold %zu clients", pool_clients.count);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
memset(c, 0, sizeof(client_t));
|
memset(c, 0, sizeof(client_t));
|
||||||
c->fd = fd;
|
c->fd = fd;
|
||||||
c->bev = bev;
|
c->bev = bev;
|
||||||
|
|
Loading…
Reference in a new issue