Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

zoo cluster size overflow vs chkdsk or scandisk for fat32 (Users)

posted by Ringding, 28.01.2024, 20:13

> I am more optimistic here: The program is open source and there will be
> FreeDOS fans who still have the compilers used for ZOO long ago. Those
> could help us out to create a fixed binary.
>
> A fix for the source code is not hard to write, just changing the data type
> for all occurances of the cluster size should be enough. So the main
> bottleneck from my point of view is finding somebody willing to compile the
> fixed sources after that.

Thanks for reminding me what a horrible development environment DOS was! :-D

The patch:

--- a/msdos.c
+++ b/msdos.c
@@ -69,7 +69,7 @@
 
 unsigned long space (drive, alloc_size)
 int drive;
-int *alloc_size;
+unsigned long *alloc_size;
 {
        unsigned long free_space;
        union REGS regs;
@@ -85,7 +85,7 @@
        /* ax=0xFFFF on error */
 
        /* cluster size = sectors/cluster * bytes/sector */
-       *alloc_size = regs.x.ax * regs.x.cx;
+       *alloc_size = (unsigned long) regs.x.ax * regs.x.cx;
 
        /* space = cluster * alloc_size */
        if (regs.x.ax == 0xffff)
--- a/zooext.c
+++ b/zooext.c
@@ -85,7 +85,7 @@
 int null_device = 0;                      /* are we sending to null device? */
 #ifndef PORTABLE
 int fast_ext = 0;                         /* fast extract as *.?Z? */
-int alloc_size;                           /* disk allocation unit size */
+unsigned long alloc_size;                 /* disk allocation unit size */
 #endif
 struct direntry direntry;                 /* directory entry */
 int first_dir = 1;                                                             /* first dir entry seen? */
--- a/zoofns.h
+++ b/zoofns.h
@@ -80,7 +80,7 @@
 void zooexit PARMS ((int));
 long inlist PARMS ((char *, unsigned int *, unsigned int *, unsigned *,
                                        unsigned *, unsigned *, long *, int));
-unsigned long space PARMS ((int, int *));
+unsigned long space PARMS ((int, unsigned long *));
 void addbfcrc PARMS ((char *, int));
 void addfname PARMS ((char *, long, unsigned int, unsigned int,
                                                        unsigned, unsigned));


The binary: 7z

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 128 users online (0 registered, 128 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum