From 975de2ffef41e6e64a2561b8f58ba2e603b2d48e Mon Sep 17 00:00:00 2001 From: Parithi R Date: Wed, 24 Sep 2025 15:22:18 +0530 Subject: [PATCH 1/2] BugFix: ini2bin fails to append SET_XDATA_ADDRESS in bin due to address init error --- lib/ini.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ini.c b/lib/ini.c index 25f0796..a7256d4 100644 --- a/lib/ini.c +++ b/lib/ini.c @@ -437,7 +437,10 @@ int switchtec_convert_ini2bin(FILE *szINIFileName, char *pclog ,BYTE *m_pBinConf BYTE byPrevXMode = SET_XMODE_NONE; BYTE byCurrXMode = SET_XMODE_NONE; unsigned int nTemp = 0; - DWORD dwCurrAddress = 0, dwPrevAddress = 0; + // This fix is required for appending - 0x80(SET_XDATA_ADDRESS) in binary due to the following condition, + // if ((dwCurrAddress < dwPrevAddress) || (wTemp > 0x7D)) + // SO, dwCurrAddress, dwPrevAddress need to be initialied to 0Xffffffff + DWORD dwCurrAddress = 0xFFFFFFFF, dwPrevAddress = 0xFFFFFFFF; BYTE byPatchCount = 0; BOOL bValidDataOffset = FALSE; WORD wDataLengthOffset = 0; From 5421dbfdedf3819712bf3e773f66e8edff5cd431 Mon Sep 17 00:00:00 2001 From: Parithi R Date: Wed, 8 Oct 2025 15:12:27 +0530 Subject: [PATCH 2/2] reverted dwCurrAddress init to 0x0 --- lib/ini.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ini.c b/lib/ini.c index a7256d4..4a947fd 100644 --- a/lib/ini.c +++ b/lib/ini.c @@ -439,8 +439,8 @@ int switchtec_convert_ini2bin(FILE *szINIFileName, char *pclog ,BYTE *m_pBinConf unsigned int nTemp = 0; // This fix is required for appending - 0x80(SET_XDATA_ADDRESS) in binary due to the following condition, // if ((dwCurrAddress < dwPrevAddress) || (wTemp > 0x7D)) - // SO, dwCurrAddress, dwPrevAddress need to be initialied to 0Xffffffff - DWORD dwCurrAddress = 0xFFFFFFFF, dwPrevAddress = 0xFFFFFFFF; + // So, dwPrevAddress need to be initialied to 0Xffffffff + DWORD dwCurrAddress = 0, dwPrevAddress = 0xFFFFFFFF; BYTE byPatchCount = 0; BOOL bValidDataOffset = FALSE; WORD wDataLengthOffset = 0;