mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 13:40:56 +00:00
Fix not closing description.txt and fix path seperator
0 length description.txt files were not closed.
This commit is contained in:
parent
51743bbb01
commit
da861ff3a2
1 changed files with 6 additions and 3 deletions
|
@ -2491,20 +2491,23 @@ void FS_GetModDescription( const char *modDir, char *description, int descriptio
|
|||
int nDescLen;
|
||||
FILE *file;
|
||||
|
||||
Com_sprintf( descPath, sizeof ( descPath ), "%s/description.txt", modDir );
|
||||
Com_sprintf( descPath, sizeof ( descPath ), "%s%cdescription.txt", modDir, PATH_SEP );
|
||||
nDescLen = FS_SV_FOpenFileRead( descPath, &descHandle );
|
||||
|
||||
if ( nDescLen > 0 && descHandle ) {
|
||||
if ( nDescLen > 0 ) {
|
||||
file = FS_FileForHandle(descHandle);
|
||||
Com_Memset( description, 0, descriptionLen );
|
||||
nDescLen = fread(description, 1, descriptionLen, file);
|
||||
if (nDescLen >= 0) {
|
||||
description[nDescLen] = '\0';
|
||||
}
|
||||
FS_FCloseFile(descHandle);
|
||||
} else {
|
||||
Q_strncpyz( description, modDir, descriptionLen );
|
||||
}
|
||||
|
||||
if ( descHandle ) {
|
||||
FS_FCloseFile( descHandle );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue