1
0
Fork 0

fixed small bug (shortname > 8 char)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@670
This commit is contained in:
Ulf Wohlers 2003-02-17 15:19:45 +00:00
parent 412d91902a
commit f89fca8d24

View file

@ -322,7 +322,7 @@ void DOS_Drive_Cache::CreateShortName(CFileInfo* curDir, CFileInfo* info)
sprintf(buffer,"%d",info->shortNr);
// Copy first letters
Bit16u tocopy;
if (len+strlen(buffer)>8) tocopy = 8 - strlen(buffer) - 1;
if (len+strlen(buffer)+1>8) tocopy = 8 - strlen(buffer) - 1;
else tocopy = len;
strncpy(info->shortname,tmpName,tocopy);
info->shortname[tocopy] = 0;