X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fcommon%2Fdiscover-client.c;h=cd9f63a9f68f584bcc5b3f26976fd6d73269ad11;hp=b1ef440a9127e927f3e6456fb25688248f05ecc7;hb=39bfdc44fdbc8091afa512bf44c70ac1b3ba15d4;hpb=47a9f94bb346817b6767d5dac578a43beee47c1f diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index b1ef440..cd9f63a 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -12,7 +12,7 @@ #include #include -#include "ui/common/discover-client.h" +#include "discover-client.h" #include "pb-protocol/pb-protocol.h" struct discover_client { @@ -46,7 +46,7 @@ struct discover_client* discover_client_init( client->ops.cb_arg = cb_arg; client->fd = socket(AF_UNIX, SOCK_STREAM, 0); - if (!client->fd < 0) { + if (client->fd < 0) { pb_log("%s: socket: %s\n", __func__, strerror(errno)); goto out_err; } @@ -111,7 +111,7 @@ static void device_remove(struct discover_client *client, const char *id) /* remove the device from the client's device array */ client->n_devices--; memmove(&client->devices[i], &client->devices[i+1], - client->n_devices - i); + (client->n_devices - i) * sizeof(client->devices[0])); client->devices = talloc_realloc(client, client->devices, struct device *, client->n_devices);