fix: spurious chars because strlen doesnt count ending zero

This commit is contained in:
iceman1001 2019-06-30 04:18:03 -04:00
parent 0eea50f5a0
commit 17f97abfcb

View file

@ -368,10 +368,10 @@ void SendVersion(void) {
struct p payload;
payload.id = *(AT91C_DBGU_CIDR);
payload.section_size = text_and_rodata_section_size + compressed_data_section_size;
payload.versionstr_len = strlen(VersionString);
memcpy(payload.versionstr, VersionString, strlen(VersionString));
payload.versionstr_len = strlen(VersionString) + 1;
memcpy(payload.versionstr, VersionString, payload.versionstr_len);
reply_ng(CMD_VERSION, PM3_SUCCESS, (uint8_t *)&payload, 12 + strlen(VersionString));
reply_ng(CMD_VERSION, PM3_SUCCESS, (uint8_t *)&payload, 12 + payload.versionstr_len);
}
// measure the Connection Speed by sending SpeedTestBufferSize bytes to client and measuring the elapsed time.