1
0
Fork 0

Fix unsafe memory operations and warnings in the fatDrive class

- Move imageDiskList from pointer to vector of unique_ptr
- Replace string operations with size-limited versions
- Initialize members
- Eliminate unecessary casts
- Eliminate memory-leak on pointer assignment
This commit is contained in:
krcroft 2019-12-07 11:55:38 -08:00 committed by Patryk Obara
parent e942a02fcb
commit c9198b2944
11 changed files with 219 additions and 131 deletions

View file

@ -85,7 +85,7 @@ static INLINE void host_writed(HostPt off,Bit32u val) {
#else
static INLINE Bit8u host_readb(HostPt off) {
return *(Bit8u *)off;
return *off;
}
static INLINE Bit16u host_readw(HostPt off) {
return *(Bit16u *)off;
@ -94,7 +94,7 @@ static INLINE Bit32u host_readd(HostPt off) {
return *(Bit32u *)off;
}
static INLINE void host_writeb(HostPt off,Bit8u val) {
*(Bit8u *)(off)=val;
*off = val;
}
static INLINE void host_writew(HostPt off,Bit16u val) {
*(Bit16u *)(off)=val;
@ -107,7 +107,7 @@ static INLINE void host_writed(HostPt off,Bit32u val) {
static INLINE void var_write(Bit8u * var, Bit8u val) {
host_writeb((HostPt)var, val);
host_writeb(var, val);
}
static INLINE void var_write(Bit16u * var, Bit16u val) {