diff --git a/kernel/fatfs.c b/kernel/fatfs.c index fd604d4..8e010a3 100644 --- a/kernel/fatfs.c +++ b/kernel/fatfs.c @@ -1919,6 +1919,16 @@ COUNT dos_setfattr(BYTE * name, UWORD attrp) #endif #ifdef WITHFAT32 +VOID dpb16to32(struct dpb FAR *dpbp) +{ + dpbp->dpb_xflags = 0; + dpbp->dpb_xfsinfosec = 0xffff; + dpbp->dpb_xbackupsec = 0xffff; + dpbp->dpb_xrootclst = 0; + dpbp->dpb_xdata = dpbp->dpb_data; + dpbp->dpb_xsize = dpbp->dpb_size; +} + VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp, BOOL extended) #else VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp) @@ -1977,14 +1987,7 @@ ckok:; : sbpb.bpb_nfsect; dpbp->dpb_xcluster = UNKNCLUSTER; dpbp->dpb_xnfreeclst = XUNKNCLSTFREE; /* number of free clusters */ - - dpbp->dpb_xflags = 0; - dpbp->dpb_xfsinfosec = 0xffff; - dpbp->dpb_xbackupsec = 0xffff; - dpbp->dpb_xrootclst = 0; - dpbp->dpb_xdata = dpbp->dpb_data; - dpbp->dpb_xsize = dpbp->dpb_size; - + dpb16to32(dpbp); if (ISFAT32(dpbp)) { dpbp->dpb_xflags = sbpb.bpb_xflags; diff --git a/kernel/proto.h b/kernel/proto.h index e48266e..56b72f2 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -182,6 +182,7 @@ COUNT dos_write(COUNT fd, const VOID FAR * buffer, UCOUNT count); LONG dos_lseek(COUNT fd, LONG foffset, COUNT origin); CLUSTER dos_free(struct dpb FAR * dpbp); BOOL dir_exists(char * path); +VOID dpb16to32(struct dpb FAR *dpbp); VOID trim_path(BYTE FAR * s);