#define MARK_CLUSTER(cluster, value) \
((uint32_t *)fat)[cluster] = SWAP_LE32(value)
-void BUG_unsupported_field_size(void);
-#define STORE_LE(field, value) \
-do { \
- if (sizeof(field) == 4) \
- field = SWAP_LE32(value); \
- else if (sizeof(field) == 2) \
- field = SWAP_LE16(value); \
- else if (sizeof(field) == 1) \
- field = (value); \
- else \
- BUG_unsupported_field_size(); \
-} while (0)
-
/* compat:
* mkdosfs 2.11 (12 Mar 2005)
* Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file]
OPT_v = 1 << 16, // verbose
};
- opt_complementary = "-1";//:b+:f+:F+:h+:r+:R+:s+:S+:vv:c--l:l--c";
- opts = getopt32(argv, "Ab:cCf:F:h:Ii:l:m:n:r:R:s:S:v",
+ opts = getopt32(argv, "^"
+ "Ab:cCf:F:h:Ii:l:m:n:r:R:s:S:v"
+ "\0" "-1", //:b+:f+:F+:h+:r+:R+:s+:S+:vv:c--l:l--c
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, &volume_label, NULL, NULL, NULL, NULL);
argv += optind;
//STORE_LE(boot_blk->reserved2[3], 0,0,0);
STORE_LE(boot_blk->vi.ext_boot_sign, 0x29);
STORE_LE(boot_blk->vi.volume_id32, volume_id);
- strncpy(boot_blk->vi.fs_type, "FAT32 ", sizeof(boot_blk->vi.fs_type));
+ memcpy(boot_blk->vi.fs_type, "FAT32 ", sizeof(boot_blk->vi.fs_type));
strncpy(boot_blk->vi.volume_label, volume_label, sizeof(boot_blk->vi.volume_label));
memcpy(boot_blk->boot_code, boot_code, sizeof(boot_code));
STORE_LE(boot_blk->boot_sign, BOOT_SIGN);