Closed rgtx closed 6 years ago
For these sample device serial number values, strlen() is hitting the null at the end of serial_hex and returning an incorrect length:
serial: 7123200 serial_hex: 6cb100 serial_modhex: hrnb ["cc" is truncated here]
strlen(ptr)/2 returns the correct length, regardless of content.
serial: 7123200 serial_hex: 6cb100 serial_modhex: hrnbcc
Credit to Gil Kloepfer for the fix.
Yes, this looks like a proper quick-fix for this issue, merging.
Thanks!
For these sample device serial number values, strlen() is hitting the null at the end of serial_hex and returning an incorrect length:
serial: 7123200 serial_hex: 6cb100 serial_modhex: hrnb ["cc" is truncated here]
strlen(ptr)/2 returns the correct length, regardless of content.
serial: 7123200 serial_hex: 6cb100 serial_modhex: hrnbcc
Credit to Gil Kloepfer for the fix.