Convert bitfields to integers in a safe way.
This is commit eb391c52ee
redone, but without the
non-standard anonymous union.
This commit is contained in:
parent
9b394bc887
commit
81afa26e4a
4 changed files with 11 additions and 2 deletions
|
@ -144,7 +144,7 @@ void dump_connections(void)
|
|||
for(node = connection_tree->head; node; node = node->next) {
|
||||
c = node->data;
|
||||
logger(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x outbuf %d/%d/%d"),
|
||||
c->name, c->hostname, c->options, c->socket, *(uint32_t *)&c->status,
|
||||
c->name, c->hostname, c->options, c->socket, bitfield_to_int(&c->status, sizeof c->status),
|
||||
c->outbufsize, c->outbufstart, c->outbuflen);
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ static void check_dead_connections(void)
|
|||
} else {
|
||||
if(c->status.remove) {
|
||||
logger(LOG_WARNING, _("Old connection_t for %s (%s) status %04x still lingering, deleting..."),
|
||||
c->name, c->hostname, *(uint32_t *)&c->status);
|
||||
c->name, c->hostname, bitfield_to_int(&c->status, sizeof c->status));
|
||||
connection_del(c);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue