Author: dchapyshev
Date: Sat Sep 17 14:04:32 2016
New Revision: 72704
URL:
http://svn.reactos.org/svn/reactos?rev=72704&view=rev
Log:
[NLS2TXT] Add missed check for default char
[TXT2NLS] Size of glyph table in words (create_nls uses wrong size)
Modified:
trunk/rosapps/applications/devutils/nls2txt/bestfit.c
trunk/rosapps/applications/devutils/nls2txt/nls.c
trunk/rosapps/applications/devutils/txt2nls/nls.c
trunk/rosapps/applications/devutils/txt2nls/txt.c
Modified: trunk/rosapps/applications/devutils/nls2txt/bestfit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/nls2…
==============================================================================
--- trunk/rosapps/applications/devutils/nls2txt/bestfit.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/devutils/nls2txt/bestfit.c [iso-8859-1] Sat Sep 17 14:04:32
2016
@@ -172,15 +172,18 @@
for (CodePageChar = 0; CodePageChar <= 0xFF; CodePageChar++)
{
- WCHAR szCharName[MAX_STR_LEN] = { 0 };
-
- GetUName(GlyphTable[CodePageChar], szCharName);
-
- BestFit_Write(hFile,
- L"0x%02X 0x%04X ;%s\r\n",
- CodePageChar,
- GlyphTable[CodePageChar],
- szCharName);
+ if (CodePageChar != CodePageTable.UniDefaultChar)
+ {
+ WCHAR szCharName[MAX_STR_LEN] = { 0 };
+
+ GetUName(GlyphTable[CodePageChar], szCharName);
+
+ BestFit_Write(hFile,
+ L"0x%02X 0x%04X ;%s\r\n",
+ CodePageChar,
+ GlyphTable[CodePageChar],
+ szCharName);
+ }
}
BestFit_Write(hFile, L"\r\n");
Modified: trunk/rosapps/applications/devutils/nls2txt/nls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/nls2…
==============================================================================
--- trunk/rosapps/applications/devutils/nls2txt/nls.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/devutils/nls2txt/nls.c [iso-8859-1] Sat Sep 17 14:04:32
2016
@@ -62,7 +62,7 @@
hFile = CreateFile(pszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0,
NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
- PUSHORT pData = NULL;
+ PUSHORT pData;
DWORD dwRead;
DWORD dwFileSize;
Modified: trunk/rosapps/applications/devutils/txt2nls/nls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/txt2…
==============================================================================
--- trunk/rosapps/applications/devutils/txt2nls/nls.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/devutils/txt2nls/nls.c [iso-8859-1] Sat Sep 17 14:04:32
2016
@@ -178,7 +178,7 @@
}
/* OEM glyph table size in words */
- size = (glyph_table ? (256 * sizeof(uint16_t)) : 0);
+ size = (glyph_table ? 256 : 0);
if (fwrite(&size, 1, sizeof(size), file) != sizeof(size))
{
Modified: trunk/rosapps/applications/devutils/txt2nls/txt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/txt2…
==============================================================================
--- trunk/rosapps/applications/devutils/txt2nls/txt.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/devutils/txt2nls/txt.c [iso-8859-1] Sat Sep 17 14:04:32
2016
@@ -140,7 +140,7 @@
int res = 0;
FILE *file;
- table = malloc(0xFF * sizeof(uint16_t));
+ table = malloc(256 * sizeof(uint16_t));
if (!table)
{
printf("Memory allocation failure\n");
@@ -148,7 +148,7 @@
}
/* Set default value for all table items */
- for (index = 0; index <= 0xFF; index++)
+ for (index = 0; index <= 255; index++)
table[index] = uni_default_char;
file = fopen(file_path, "r");
@@ -254,7 +254,7 @@
int found;
FILE *file;
- table = malloc(0xFFFF * (is_dbcs ? sizeof(uint16_t) : sizeof(uint8_t)));
+ table = malloc(65536 * (is_dbcs ? sizeof(uint16_t) : sizeof(uint8_t)));
if (!table)
{
printf("Memory allocation failure\n");
@@ -262,7 +262,7 @@
}
/* Set default value for all table items */
- for (index = 0; index <= 0xFFFF; index++)
+ for (index = 0; index <= 65535; index++)
{
/* DBCS code page */
if (is_dbcs)
@@ -393,7 +393,7 @@
int res = 0;
FILE *file;
- table = malloc(0xFF * sizeof(uint16_t));
+ table = malloc(256 * sizeof(uint16_t));
if (!table)
{
printf("Memory allocation failure\n");
@@ -401,7 +401,7 @@
}
/* Set default value for all table items */
- for (index = 0; index <= 0xFF; index++)
+ for (index = 0; index <= 255; index++)
table[index] = uni_default_char;
file = fopen(file_path, "r");