#define NTFSCLONE_IMG_VER_MAJOR 10
#define NTFSCLONE_IMG_VER_MINOR 1
+enum { CMD_GAP, CMD_NEXT } ;
+
/* All values are in little endian. */
static struct image_hdr {
char magic[IMAGE_MAGIC_SIZE];
}
if (opt.save_image || (opt.metadata_image && wipe)) {
- char cmd = 1;
+ char cmd = CMD_NEXT;
if (write_all(&fd_out, &cmd, sizeof(cmd)) == -1)
perr_exit("write_all");
}
if (gap) {
count = cpu_to_sle64(gap);
- buf[0] = 0;
+ buf[0] = CMD_GAP;
memcpy(&buf[1], &count, sizeof(count));
if (write_all(&fd_out, buf, sizeof(buf)) == -1)
perr_exit("write_all");
s64 count_buf;
char buff[1 + sizeof(count)];
- buff[0] = 0;
+ buff[0] = CMD_GAP;
count_buf = cpu_to_sle64(count);
memcpy(buff + 1, &count_buf, sizeof(count_buf));
perr_exit("read_all");
}
- if (cmd == 0) {
+ if (cmd == CMD_GAP) {
if (!image_is_host_endian) {
le64 lecount;
perr_exit("restore_image: lseek");
}
pos += count;
- } else if (cmd == 1) {
+ } else if (cmd == CMD_NEXT) {
copy_cluster(0, 0, pos);
pos++;
progress_update(&progress, ++p_counter);
{
u32 k;
s64 target_lcn;
- char cmd = 1;
+ char cmd = CMD_NEXT;
for (k=0; k<cnt; k++) {
target_lcn = rl[wi].lcn + wj;