Skip to content

Commit bfe16d8

Browse files
authored
Update f3fix.c
1 parent fa33631 commit bfe16d8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

f3fix.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static void parse_args(int argc, char **argv, struct args *args) {
124124
static long long arg_to_long_long(const struct argp_state *state, const char *arg);
125125
static void list_disk_types(void);
126126
static void list_fs_types(void);
127+
static PedSector map_sector_to_logical_sector(PedSector sector, int logical_sector_size);
127128
static int fix_disk(PedDevice *dev, PedDiskType *type, PedFileSystemType *fs_type, int boot, PedSector start, PedSector end);
128129

129130
static char adoc[] = "<DISK_DEV>";
@@ -334,8 +335,8 @@ int main(int argc, char *argv[]) {
334335
.list_disk_types = false,
335336
.list_fs_types = false,
336337
.boot = true,
337-
.disk_type = "msdos",
338-
.fs_type = "fat32",
338+
.disk_type = ped_disk_type_get("msdos"), // Исправлено
339+
.fs_type = ped_file_system_type_get("fat32"), // Исправлено
339340
.first_sec = DEFAULT_FIRST_SEC,
340341
.last_sec = -1
341342
};
@@ -402,11 +403,15 @@ int main(int argc, char *argv[]) {
402403
*/
403404
return 0;
404405
}
405-
406+
407+
if (!args.disk_type || !args.fs_type) {
408+
fprintf(stderr, "Invalid disk or filesystem type\n");
409+
return 1;
410+
}
411+
406412
/* XXX If @dev is a partition, refer the user to
407413
* the disk of this partition.
408414
*/
409-
//dev = ped_device_get(args.dev_filename);
410415
if (!dev)
411416
return 1;
412417

0 commit comments

Comments
 (0)