diff options
author | Ladislav Zezula <zezula@volny.cz> | 2025-06-02 20:28:39 +0200 |
---|---|---|
committer | Ladislav Zezula <zezula@volny.cz> | 2025-06-02 20:28:39 +0200 |
commit | 630de2ee1925d1d1b9bf1404e189a5a319ee3c1e (patch) | |
tree | e8c394394c8c4cd19f8989967c6b36f7dc0f844e /src | |
parent | 0ce73c5b464cb438f9faae69c5a8305241898b54 (diff) |
Fixed bug in test program that caused bad cosmetic effects during log print
Diffstat (limited to 'src')
-rw-r--r-- | src/SFileOpenArchive.cpp | 2 | ||||
-rw-r--r-- | src/SMemUtf8.cpp | 4 | ||||
-rw-r--r-- | src/StormCommon.h | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/SFileOpenArchive.cpp b/src/SFileOpenArchive.cpp index 7b55a8c..17fc7c9 100644 --- a/src/SFileOpenArchive.cpp +++ b/src/SFileOpenArchive.cpp @@ -30,7 +30,7 @@ typedef struct _IMAGE_DOS_HEADER { USHORT e_magic; - USHORT dummy[0x1B]; + USHORT dummy[0x1D]; DWORD e_lfanew; } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; diff --git a/src/SMemUtf8.cpp b/src/SMemUtf8.cpp index 5832422..7f03e77 100644 --- a/src/SMemUtf8.cpp +++ b/src/SMemUtf8.cpp @@ -92,7 +92,7 @@ static DWORD UTF8_DecodeSequence(const BYTE * pbString, BYTE BitsMask, size_t cc } // https://en.wikipedia.org/wiki/UTF-8 -static DWORD UTF8_DecodeCodePoint(const BYTE * pbString, const BYTE * pbStringEnd, DWORD & dwCodePoint, size_t & ccBytesEaten) +DWORD UTF8_DecodeCodePoint(const BYTE * pbString, const BYTE * pbStringEnd, DWORD & dwCodePoint, size_t & ccBytesEaten) { // Reset the number of bytes eaten dwCodePoint = SFILE_UTF8_INVALID_CHARACTER; @@ -165,7 +165,7 @@ static size_t UTF8_EncodeSequence(DWORD dwCodePoint, BYTE LeadingByte, DWORD dwF return dwFollowByteCount + 1; } -static size_t UTF8_EncodeCodePoint(DWORD dwCodePoint, LPBYTE Utf8Buffer) +size_t UTF8_EncodeCodePoint(DWORD dwCodePoint, LPBYTE Utf8Buffer) { // 0x00 - 0x7F, 1 byte if(dwCodePoint < 0x80) diff --git a/src/StormCommon.h b/src/StormCommon.h index bf82039..52f5cd0 100644 --- a/src/StormCommon.h +++ b/src/StormCommon.h @@ -277,6 +277,12 @@ void StringCat(TCHAR * szTarget, size_t cchTargetMax, const char * szSource); #endif
//-----------------------------------------------------------------------------
+// UTF-8 support
+
+DWORD UTF8_DecodeCodePoint(const BYTE * pbString, const BYTE * pbStringEnd, DWORD & dwCodePoint, size_t & ccBytesEaten);
+size_t UTF8_EncodeCodePoint(DWORD dwCodePoint, LPBYTE Utf8Buffer);
+
+//-----------------------------------------------------------------------------
// Encryption and decryption functions
#define MPQ_HASH_TABLE_INDEX 0x000
|