@@ -253,12 +253,12 @@ bool CUSBCECAdapterCommands::RequestSettingOSDName(void)
253253 if (response.size == 0 )
254254 {
255255 LIB_CEC->AddLog (CEC_LOG_DEBUG, " no persisted device name setting" );
256- memset ( m_persistedConfiguration.strDeviceName , 0 , 13 ) ;
256+ m_persistedConfiguration.strDeviceName [ 0 ] = ( char ) 0 ;
257257 return false ;
258258 }
259259
260- memcpy (m_persistedConfiguration.strDeviceName , response.data , response.size <= 13 ? response.size : 13 );
261- if (response.size < 13 ) {
260+ memcpy (m_persistedConfiguration.strDeviceName , response.data , response.size <= LIBCEC_OSD_NAME_SIZE ? response.size : LIBCEC_OSD_NAME_SIZE );
261+ if (response.size < LIBCEC_OSD_NAME_SIZE ) {
262262 m_persistedConfiguration.strDeviceName [response.size ] = (char )0 ;
263263 }
264264 return true ;
@@ -511,7 +511,7 @@ bool CUSBCECAdapterCommands::SetSettingOSDName(const char *strOSDName)
511511 SAFE_DELETE (message);
512512
513513 if (bReturn)
514- snprintf (m_persistedConfiguration.strDeviceName , 13 , " %s" , strOSDName);
514+ snprintf (m_persistedConfiguration.strDeviceName , LIBCEC_OSD_NAME_SIZE , " %s" , strOSDName);
515515
516516 return bReturn;
517517}
@@ -623,7 +623,7 @@ bool CUSBCECAdapterCommands::GetConfiguration(libcec_configuration &configuratio
623623 configuration.iFirmwareVersion = m_persistedConfiguration.iFirmwareVersion ;
624624 configuration.deviceTypes = m_persistedConfiguration.deviceTypes ;
625625 configuration.iPhysicalAddress = m_persistedConfiguration.iPhysicalAddress ;
626- snprintf (configuration.strDeviceName , 13 , " %s" , m_persistedConfiguration.strDeviceName );
626+ snprintf (configuration.strDeviceName , LIBCEC_OSD_NAME_SIZE , " %s" , m_persistedConfiguration.strDeviceName );
627627
628628 return true ;
629629}
0 commit comments