From e6a9638b74d62a58e36a5dcedc8f2df19ad99453 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Fri, 25 Oct 2002 15:39:34 +0000 Subject: [PATCH] Create temp file fixed and a little fix with a warning Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@416 --- src/dos/dos_files.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index 4949fa45..99217e38 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -200,7 +200,7 @@ bool DOS_FindFirst(char * search,Bit16u attr) { strcpy(pattern,find_last+1); strcpy(dir,fullsearch); } - dta.SetupSearch(drive,attr | DOS_ATTR_ARCHIVE,pattern); + dta.SetupSearch(drive,(Bit8u)attr,pattern); if (Drives[drive]->FindFirst(dir,dta)) return true; DOS_SetError(DOSERR_FILE_NOT_FOUND); return false; @@ -454,8 +454,7 @@ bool DOS_ForceDuplicateEntry(Bit16u entry,Bit16u newentry) { bool DOS_CreateTempFile(char * name,Bit16u * entry) { - -/* First add random crap to the end of the name and try to open */ + /* First add random crap to the end of the name and try to open */ /* Todo maybe check for euhm existence of the path name */ char * tempname; tempname=name+strlen(name); @@ -468,7 +467,7 @@ bool DOS_CreateTempFile(char * name,Bit16u * entry) { for (i=9;i<12;i++) { tempname[i]=(rand()%26)+'A'; } - tempname[13]=0; + tempname[12]=0; } while (!DOS_CreateFile(name,0,entry)); return true; }