Fix three network-related warnings.
This commit is contained in:
@@ -401,6 +401,7 @@ net_netswitch_init(const netcard_t *card, const uint8_t *mac_addr, void *priv, c
|
|||||||
memcpy(ns_args.mac_addr, net_netswitch->mac_addr, 6);
|
memcpy(ns_args.mac_addr, net_netswitch->mac_addr, 6);
|
||||||
/* The remote switch hostname */
|
/* The remote switch hostname */
|
||||||
strncpy(ns_args.nrs_hostname, netcard->nrs_hostname, sizeof(ns_args.nrs_hostname) - 1);
|
strncpy(ns_args.nrs_hostname, netcard->nrs_hostname, sizeof(ns_args.nrs_hostname) - 1);
|
||||||
|
ns_args.nrs_hostname[127] = 0x00;
|
||||||
|
|
||||||
net_switch_log("%s Net Switch: Starting up virtual switch with group %d, flags %d\n", net_netswitch->switch_type, ns_args.group, ns_args.flags);
|
net_switch_log("%s Net Switch: Starting up virtual switch with group %d, flags %d\n", net_netswitch->switch_type, ns_args.group, ns_args.flags);
|
||||||
|
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ ns_open(struct ns_open_args *open_args) {
|
|||||||
|
|
||||||
/* Remote switch hostname */
|
/* Remote switch hostname */
|
||||||
strncpy(conn->nrs_hostname, open_args->nrs_hostname, sizeof(conn->nrs_hostname) - 1);
|
strncpy(conn->nrs_hostname, open_args->nrs_hostname, sizeof(conn->nrs_hostname) - 1);
|
||||||
|
conn->nrs_hostname[127] = 0x00;
|
||||||
|
|
||||||
/* Switch type */
|
/* Switch type */
|
||||||
if(conn->switch_type == SWITCH_TYPE_REMOTE) {
|
if(conn->switch_type == SWITCH_TYPE_REMOTE) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, si
|
|||||||
pb_byte_t *dest = (pb_byte_t*)stream->state;
|
pb_byte_t *dest = (pb_byte_t*)stream->state;
|
||||||
stream->state = dest + count;
|
stream->state = dest + count;
|
||||||
|
|
||||||
|
if ((dest != NULL) && (buf != NULL))
|
||||||
memcpy(dest, buf, count * sizeof(pb_byte_t));
|
memcpy(dest, buf, count * sizeof(pb_byte_t));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user