summaryrefslogtreecommitdiff
path: root/core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch
diff options
context:
space:
mode:
Diffstat (limited to 'core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch')
-rw-r--r--core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch b/core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch
new file mode 100644
index 000000000..44e6e86b5
--- /dev/null
+++ b/core/dosfstools/dosfstools-3.0.12-fix-alloc-rootdir-entry.patch
@@ -0,0 +1,25 @@
+--- dosfstools-3.0.12/src/check.c.old 2010-01-23 10:13:17.000000000 +0100
++++ dosfstools-3.0.12/src/check.c 2011-01-31 17:43:31.462674941 +0100
+@@ -174,7 +174,10 @@
+ offset = fs->root_start + next_free * sizeof(DIR_ENT);
+ memset(de, 0, sizeof(DIR_ENT));
+ while (1) {
+- sprintf((char *)de->name, pattern, curr_num);
++ char expanded[12];
++ sprintf(expanded, pattern, curr_num);
++ memcpy(de->name, expanded, 8);
++ memcpy(de->ext, expanded + 8, 3);
+ for (scan = 0; scan < fs->root_entries; scan++)
+ if (scan != next_free &&
+ !strncmp((const char *)root[scan].name,
+--- dosfstools-3.0.12/src/fat.c
++++ dosfstools-3.0.12/src/fat.c
+@@ -474,7 +474,7 @@ void reclaim_file(DOS_FS * fs)
+ DIR_ENT de;
+ loff_t offset;
+ files++;
+- offset = alloc_rootdir_entry(fs, &de, "FSCK%04d");
++ offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC");
+ de.start = CT_LE_W(i & 0xffff);
+ if (fs->fat_bits == 32)
+ de.starthi = CT_LE_W(i >> 16);