Menu

#445 DOS FindFirst and FindNext names should be space padded

0.74
fixed
None
1
2016-09-19
2016-09-19
No

I've got a fairly old QBASIC program that uses FindFirst and FindNext. When running under MSDOS in VMWare it works correctly, but it prints garbage when run under DOSBox. The problem appears to be that FindFirst and FindNext do not fully pad the name field in the DTA with spaces as DOS normally does. For programs written in languages that do not respecting trailing NULs, this may result in garbage printed to the screen.

The following kludge fixes it:

 void DOS_DTA::SetResult(const char * _name,Bit32u _size,Bit16u _date,Bit16u _time,Bit8u _attr) {

+   char name[DOS_NAMELENGTH_ASCII];
+   memset(name, ' ', DOS_NAMELENGTH_ASCII);
+   strcpy(name, _name);
+   MEM_BlockWrite(pt+offsetof(sDTA,name),(void *)name,DOS_NAMELENGTH_ASCII);

Discussion

  • ripsaw8080

    ripsaw8080 - 2016-09-19

    Please try current source. The issue should have been resolved by r3945.

     
  • Matthew Mastracci

    Yep. I just tested and this appears to fix it... thanks for the heads up, feel free to close this.

     
  • Qbix

    Qbix - 2016-09-19
    • status: open --> fixed
    • assigned_to: ripsaw8080
     

Log in to post a comment.

MongoDB Logo MongoDB