Fix 'dosfslabel throws "Seek to 114116076544:Invalid argument" error when labeling'.
See https://bugzilla.redhat.com/show_bug.cgi?id=693662 for more information. Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
This commit is contained in:
parent
e243612ccd
commit
d039482656
@ -82,7 +82,7 @@ static void check_atari(void)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
DOS_FS fs;
|
DOS_FS fs = {0};
|
||||||
rw = 0;
|
rw = 0;
|
||||||
|
|
||||||
char *device = NULL;
|
char *device = NULL;
|
||||||
@ -113,6 +113,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fs_open(device, rw);
|
fs_open(device, rw);
|
||||||
read_boot(&fs);
|
read_boot(&fs);
|
||||||
|
if (fs.fat_bits == 32)
|
||||||
|
read_fat(&fs);
|
||||||
if (!rw) {
|
if (!rw) {
|
||||||
fprintf(stdout, "%s\n", fs.label);
|
fprintf(stdout, "%s\n", fs.label);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|||||||
@ -86,8 +86,10 @@ void read_fat(DOS_FS * fs)
|
|||||||
unsigned long total_num_clusters;
|
unsigned long total_num_clusters;
|
||||||
|
|
||||||
/* Clean up from previous pass */
|
/* Clean up from previous pass */
|
||||||
free(fs->fat);
|
if (fs->fat)
|
||||||
free(fs->cluster_owner);
|
free(fs->fat);
|
||||||
|
if (fs->cluster_owner)
|
||||||
|
free(fs->cluster_owner);
|
||||||
fs->fat = NULL;
|
fs->fat = NULL;
|
||||||
fs->cluster_owner = NULL;
|
fs->cluster_owner = NULL;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user