summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-06-04 08:55:20 -0700
committerXin Li <delphij@google.com>2019-06-04 08:55:20 -0700
commit8b5aba4086d8d8188ea626632232ecf371e19104 (patch)
tree552d24db5f7fcd3d5a7bcb1a6b3aca2232457359
parent760f5401a046bf4f03f52300af30d502fc4e6170 (diff)
downloadfsck_msdos-8b5aba4086d8d8188ea626632232ecf371e19104.tar.gz
Import revision 55bd3d1288913467e83041b9c05d54c4f575bc5d from FreeBSD.
Change-Id: I2c7ac2360d60cf44faa895822be0e7987558464d
-rw-r--r--dir.c4
-rw-r--r--fat.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index b990b0c..e59536f 100644
--- a/dir.c
+++ b/dir.c
@@ -115,7 +115,7 @@ newDosDirEntry(void)
struct dosDirEntry *de;
if (!(de = freede)) {
- if (!(de = (struct dosDirEntry *)malloc(sizeof *de)))
+ if (!(de = malloc(sizeof *de)))
return 0;
} else
freede = de->next;
@@ -140,7 +140,7 @@ newDirTodo(void)
struct dirTodoNode *dt;
if (!(dt = freedt)) {
- if (!(dt = (struct dirTodoNode *)malloc(sizeof *dt)))
+ if (!(dt = malloc(sizeof *dt)))
return 0;
} else
freedt = dt->next;
diff --git a/fat.c b/fat.c
index 7ea0274..6ea5218 100644
--- a/fat.c
+++ b/fat.c
@@ -645,8 +645,8 @@ writefat(int fs, struct bootblock *boot, struct fatEntry *fat, int correct_fat)
break;
if (fat[cl].next == CLUST_FREE)
boot->NumFree++;
- *p++ |= (u_char)(fat[cl + 1].next << 4);
- *p++ = (u_char)(fat[cl + 1].next >> 4);
+ *p++ |= (u_char)(fat[cl].next << 4);
+ *p++ = (u_char)(fat[cl].next >> 4);
break;
}
}