mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-25 05:29:34 +00:00
21 June 2003
+ Fix error where we could allocate a used sector! ARGH!
This commit is contained in:
parent
04ac80431e
commit
25b5b8a946
2
Changelog
Normal file
2
Changelog
Normal file
@ -0,0 +1,2 @@
|
||||
21 June 2003
|
||||
+ Fix error where we could allocate a used sector! ARGH!
|
6
dos33.c
6
dos33.c
@ -250,6 +250,8 @@ int find_first_one(unsigned char byte) {
|
||||
|
||||
int i=0;
|
||||
|
||||
if (byte==0) return -1;
|
||||
|
||||
while((byte& (0x1<<i))==0) {
|
||||
i++;
|
||||
}
|
||||
@ -313,7 +315,7 @@ int dos33_allocate_sector(int fd) {
|
||||
|
||||
do {
|
||||
|
||||
for(byte=0;byte<2;byte++) {
|
||||
for(byte=1;byte>-1;byte--) {
|
||||
|
||||
bitmap[byte]=buffer[VTOC_FREE_BITMAPS+(i*4)+byte];
|
||||
if (bitmap[byte]!=0x00) {
|
||||
@ -321,7 +323,7 @@ int dos33_allocate_sector(int fd) {
|
||||
found_track=i;
|
||||
/* clear bit indicating in use */
|
||||
buffer[VTOC_FREE_BITMAPS+(i*4)+byte]&=~(0x1<<found_sector);
|
||||
found_sector+=(8*byte);
|
||||
found_sector+=(8*(1-byte));
|
||||
goto found_one;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user