fsParser: fix usercode/checksum size

This commit is contained in:
Gwenhael Goavec-Merou 2023-02-16 19:59:58 +01:00
parent 2449afa135
commit 6f070d8e97
1 changed files with 2 additions and 2 deletions

View File

@ -70,8 +70,8 @@ int FsParser::parseHeader()
snprintf(&_hdr["idcode"][0], 9, "%08x", _idcode);
break;
case 0x0A: /* user code or checksum ? */
_hdr["CheckSum"] = string(4, ' ');
snprintf(&_hdr["CheckSum"][0], 5, "%04x", (uint16_t)(0xffff & val));
_hdr["CheckSum"] = string(8, ' ');
snprintf(&_hdr["CheckSum"][0], 9, "%08x", (uint32_t)(0xffffffff & val));
break;
case 0x0B: /* only present when bit_security is set */
_hdr["SecurityBit"] = "ON";