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;
}
/* 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);