X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecSharp%2FLibCecSharp.cpp;h=0bae3eaca39e9d820f49b605968b6e39d78fa580;hb=cf845048f1e3eabec1b4092126660288eef71ed3;hp=889bd4758d1fbe2c647ea216fb9d057caba00361;hpb=b155d19ae0d1edfabda4991c747ea73b7a4c1471;p=deb_libcec.git 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); } ///