1
0
Fork 0

Don't write past the terminator in the DTA name field when setting search results. This is what DOS does, and writing junk after the terminator was not good in any case. Fixes file listing in the 16-bit version of Galaxy Player.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3945
This commit is contained in:
ripsaw8080 2015-10-03 09:21:56 +00:00
parent 1eecef3f33
commit 6c0cca1878

View file

@ -340,7 +340,7 @@ void DOS_DTA::SetupSearch(Bit8u _sdrive,Bit8u _sattr,char * pattern) {
}
void DOS_DTA::SetResult(const char * _name,Bit32u _size,Bit16u _date,Bit16u _time,Bit8u _attr) {
MEM_BlockWrite(pt+offsetof(sDTA,name),(void *)_name,DOS_NAMELENGTH_ASCII);
MEM_BlockWrite(pt+offsetof(sDTA,name),(void *)_name,strlen(_name)+1);
sSave(sDTA,size,_size);
sSave(sDTA,date,_date);
sSave(sDTA,time,_time);