From cf845048f1e3eabec1b4092126660288eef71ed3 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 8 Mar 2013 13:45:03 +0100 Subject: [PATCH] LibCecSharp: fixed 14 char long OSD name (wasn't \0 terminated) --- src/LibCecSharp/LibCecSharp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 889bd47..0bae3ea 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -474,7 +474,11 @@ namespace CecSharp String ^ GetDeviceOSDName(CecLogicalAddress logicalAddress) { cec_osd_name osd = m_libCec->GetDeviceOSDName((cec_logical_address) logicalAddress); - return gcnew String(osd.name); + // we need to terminate with \0, and we only got 14 chars in osd.name + char strOsdName[15]; + memset(strOsdName, 0, sizeof(strOsdName)); + memcpy(strOsdName, osd.name, sizeof(osd.name)); + return gcnew String(strOsdName); } /// -- 2.34.1