Remove 'new_snaps' since it only used for a sizeof() call,
get the size directly from the data type of new_snaps instead.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
struct rbd_obj_header_ondisk *header;
bufferlist newbl;
bufferptr header_bp(sizeof(*header));
- struct rbd_obj_snap_ondisk *new_snaps;
int rc = snap_read_header(hctx, bl);
if (rc < 0)
header = (struct rbd_obj_header_ondisk *)bl.c_str();
int snaps_id_ofs = sizeof(*header);
- int names_ofs = snaps_id_ofs + sizeof(*new_snaps) * header->snap_count;
+ int names_ofs = snaps_id_ofs + sizeof(struct rbd_obj_snap_ondisk) * header->snap_count;
const char *snap_name;
const char *snap_names = ((char *)header) + names_ofs;
const char *orig_names = snap_names;
return rc;
return 0;
-
}