Signed-off-by: Scott Talbert <s...@techie.net> --- libconcord/remote.cpp | 4 ++-- libconcord/remote_z.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/libconcord/remote.cpp b/libconcord/remote.cpp index 81735c7..9cc0dbb 100644 --- a/libconcord/remote.cpp +++ b/libconcord/remote.cpp @@ -55,8 +55,8 @@ void setup_ri_pointers(TRemoteInfo &ri) void make_guid(const uint8_t * const in, char*&out) { char x[48]; - // usbnet remotes seem to use a more normal byte ordering for serial #'s - if (is_usbnet_remote() || is_mh_remote()) { + // Non-HID remotes seem to use a more normal byte ordering for serial #'s + if (is_z_remote() || is_mh_remote()) { sprintf(x, GUID_STR, in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9], in[10], in[11], in[12], in[13], in[14], in[15]); diff --git a/libconcord/remote_z.cpp b/libconcord/remote_z.cpp index f7ffa1a..a5e76be 100644 --- a/libconcord/remote_z.cpp +++ b/libconcord/remote_z.cpp @@ -127,7 +127,12 @@ int CRemoteZ_HID::UDP_Read(uint8_t &status, uint32_t &len, uint8_t *data) len = pkt[0] - 4; //if(!len) return 0; //memcpy(data, pkt + 6, len); - memcpy(data, pkt + 1, len + 3); + /* + * pkt[0] is the index of the last byte, which means it is equal to the + * length of the packet minus one byte. We want to copy everything but the + * first byte, so we copy pkt[0] bytes. + */ + memcpy(data, pkt + 1, pkt[0]); return 0; } -- 1.8.1.4 ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ concordance-devel mailing list concordance-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/concordance-devel