fix(vdf): support for windows 125x encoding.

This commit is contained in:
tzarchat 2022-09-10 19:55:42 +02:00 committed by GitHub
parent 0d4e9aac45
commit e4d1f5c412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -71,12 +71,7 @@ static int vdfLoadEntries(PHYSFS_Io *io, const PHYSFS_uint32 count,
name[VDF_ENTRY_NAME_LENGTH] = '\0'; /* always null-terminated. */
for (namei = VDF_ENTRY_NAME_LENGTH - 1; namei >= 0; namei--)
{
/* We assume the filenames are low-ASCII; consider the archive
corrupt if we see something above 127, since we don't know the
encoding. (We can change this later if we find out these exist
and are intended to be, say, latin-1 or UTF-8 encoding). */
BAIL_IF(((PHYSFS_uint8) name[namei]) > 127, PHYSFS_ERR_CORRUPT, 0);
/* VDFS filenames uses Windows-125x encoding, which depends of the region. */
if (name[namei] == ' ')
name[namei] = '\0';
else