return next == i + 16 ? i : next;
}
-static void dump_buffer(off_t base, unsigned char *buf, size_t sz, int all)
+static void dump_buffer(off_t base, unsigned char *buf, size_t sz)
{
size_t i, l, next = 0;
return;
for (i = 0, l = 0; i < sz; i++, l++) {
if (l == 0) {
- if (all == 0 && !next)
+ if (!next)
next = skip_empty(buf, i, sz);
printf("%08jx ", (intmax_t)base + i);
}
}
static void dump_blkdev(struct fdisk_context *cxt, const char *name,
- uint64_t offset, size_t size, int all)
+ uint64_t offset, size_t size)
{
int fd = fdisk_get_devfd(cxt);
if (read_all(fd, (char *) buf, size) != (ssize_t) size)
fdisk_warn(cxt, _("cannot read"));
else
- dump_buffer(offset, buf, size, all);
+ dump_buffer(offset, buf, size);
free(buf);
}
}
void dump_firstsector(struct fdisk_context *cxt)
{
- int all = !isatty(STDOUT_FILENO);
-
assert(cxt);
- dump_blkdev(cxt, _("First sector"), 0, fdisk_get_sector_size(cxt), all);
+ dump_blkdev(cxt, _("First sector"), 0, fdisk_get_sector_size(cxt));
}
void dump_disklabel(struct fdisk_context *cxt)
{
- int all = !isatty(STDOUT_FILENO);
int i = 0;
const char *name = NULL;
uint64_t offset = 0;
assert(cxt);
while (fdisk_locate_disklabel(cxt, i++, &name, &offset, &size) == 0 && size)
- dump_blkdev(cxt, name, offset, size, all);
+ dump_blkdev(cxt, name, offset, size);
}
static fdisk_sector_t get_dev_blocks(char *dev)