diff --git a/src/fat/fat12.c b/src/fat/fat12.c index c1c7efa..529f245 100644 --- a/src/fat/fat12.c +++ b/src/fat/fat12.c @@ -121,12 +121,12 @@ int fat12_allocclusters(image* img, bpb16* bpb, int cluster_count) { if (!cluster) { if (prev_al_clus) { if (prev_al_clus % 2) { - fat_start[prev_al_clus/2].odd_clust1 = (char)(i&0xF); - fat_start[prev_al_clus/2].odd_clust2 = (char)(i>>8); + fat_start[prev_al_clus/2].odd_clust1 = (char)(i&0x00F); + fat_start[prev_al_clus/2].odd_clust2 = (char)(i>>4); } else { fat_start[prev_al_clus/2].even_clust1 = (char)i; - fat_start[prev_al_clus/2].even_clust2 = (char)((i>>8)&0xF); + fat_start[prev_al_clus/2].even_clust2 = (char)((i>>8)&0x0F); } } prev_al_clus = i; @@ -184,7 +184,7 @@ void fat12_write_file_via_cluster_chain(char* data, size_t data_size, int nclus = 0; if (clustern%2) { nclus |= (fat[clustern/2].odd_clust1 & 0xF); - nclus |= fat[clustern/2].odd_clust2 << 8; + nclus |= fat[clustern/2].odd_clust2 << 4; } else { nclus |= fat[clustern/2].even_clust1; nclus |= fat[clustern/2].even_clust2 << 8 ; diff --git a/src/main.c b/src/main.c index 37a6125..3794061 100644 --- a/src/main.c +++ b/src/main.c @@ -94,7 +94,6 @@ void mode_add(mkimg_args* args) { } int main(int argc, char* argv[]) { - printf("%u\n",sizeof(bpb16)); mkimg_args* args = arg_parse(argc, argv); switch (args->mode) { case create: