From 25b5b8a946a8e236c190a0bb672acf780ec61dd9 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 21 Jun 2003 22:26:00 -0400 Subject: [PATCH] 21 June 2003 + Fix error where we could allocate a used sector! ARGH! --- Changelog | 2 ++ dos33.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Changelog diff --git a/Changelog b/Changelog new file mode 100644 index 00000000..423be330 --- /dev/null +++ b/Changelog @@ -0,0 +1,2 @@ +21 June 2003 ++ Fix error where we could allocate a used sector! ARGH! diff --git a/dos33.c b/dos33.c index 386cf450..0a64acc2 100644 --- a/dos33.c +++ b/dos33.c @@ -250,6 +250,8 @@ int find_first_one(unsigned char byte) { int i=0; + if (byte==0) return -1; + while((byte& (0x1<-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<