--- cifxapi.c Tue Oct 08 09:31:00 2013 +++ cifxapi.c Tue Oct 08 08:27:24 2013 @@ -648,7 +648,7 @@ { if(s_atErrorToDescrTable[iIdx].lError == lError) { - OS_Strncpy(szBuffer, ulBufferLen, s_atErrorToDescrTable[iIdx].szErrorDescr, ulBufferLen); + OS_Strncpy(szBuffer, s_atErrorToDescrTable[iIdx].szErrorDescr, ulBufferLen); lRet = CIFX_NO_ERROR; break; } --- cifXHelper.c Tue Oct 08 09:31:00 2013 +++ cifXHelper.c Tue Oct 08 08:27:15 2013 @@ -326,7 +326,6 @@ ptSendPkt->tData.ulChannelNo = HOST_TO_LE32(ulChannel); ptSendPkt->tData.usFileNameLength = HOST_TO_LE16((uint16_t)ulFileNameLength); OS_Strncpy( (char*)(ptSendPkt + 1), - ulFileNameLength, szFileName, ulFileNameLength) ; @@ -597,7 +596,7 @@ ptUploadReq->tData.ulMaxBlockSize = HOST_TO_LE32(ulBlockSize); ptUploadReq->tData.ulChannelNo = HOST_TO_LE32(ulChannel); - OS_Strncpy((char*)(ptUploadReq + 1), usFilenameLen, szFileName, usFilenameLen); + OS_Strncpy((char*)(ptUploadReq + 1), szFileName, usFilenameLen); lRet = DEV_TransferPacket(pvChannel, &tSendPacket, @@ -891,7 +890,7 @@ ptRequest->tData.usFileNameLength = HOST_TO_LE16( (usFileNameLen + 1) ); /* Insert file name */ - OS_Strncpy( (char*)(ptRequest + 1), usFileNameLen, pszFileName, usFileNameLen); + OS_Strncpy( (char*)(ptRequest + 1), pszFileName, usFileNameLen); /* Send delete packet */ lRet = DEV_TransferPacket( pvChannel, --- HilTransport.c Tue Oct 08 09:31:00 2013 +++ HilTransport.c Tue Oct 08 08:27:05 2013 @@ -297,7 +297,7 @@ ptTransport->ptConnector = ptConnector; ptTransport->pvConnectorData = pvConnectorData; - OS_Strncpy(ptTransport->szInterfaceName, 16, szInterfaceName, 16); + OS_Strncpy(ptTransport->szInterfaceName, szInterfaceName, 16); /* Try to open the interface */ if(NULL != (ptTransport->pvConnectorInterface = ptConnector->tFunctions.pfnConCreateInterface(szInterfaceName))) @@ -1927,4 +1927,4 @@ } return lRet; -} \ No newline at end of file +} --- netXTransport.c Tue Oct 08 09:31:00 2013 +++ netXTransport.c Tue Oct 08 08:28:22 2013 @@ -668,7 +668,7 @@ if ((hNetxTransportDeviceHandle != NULL) && (szDeviceName != NULL)) { NETXTRANSPORT_DEVICE_HANDLE_T* ptNetXTransportDeviceHandle = (NETXTRANSPORT_DEVICE_HANDLE_T*)hNetxTransportDeviceHandle; - OS_Strncpy( szDeviceName, ulStrlen, ptNetXTransportDeviceHandle->ptGenericDevice->szDeviceName, OS_Strlen(ptNetXTransportDeviceHandle->ptGenericDevice->szDeviceName)); + OS_Strncpy( szDeviceName, ptNetXTransportDeviceHandle->ptGenericDevice->szDeviceName, ulStrlen); } } @@ -878,7 +878,7 @@ /* create new interface */ TAILQ_INSERT_TAIL(&s_tNetXTransportInfo.tnetXTransportInterface, ptIF, tList); - OS_Strncpy(ptIF->szInterfaceName, 16, szInterfaceName, 16); + OS_Strncpy(ptIF->szInterfaceName, szInterfaceName, 16); TAILQ_INIT(&ptIF->tDeviceRefList); @@ -1384,7 +1384,7 @@ ptGenericDevice->pvDeviceLock = OS_CreateLock(); ptGenericDevice->pvEvent = NULL; - OS_Strncpy( ptGenericDevice->szDeviceName, 16, szDeviceName, 16); + OS_Strncpy( ptGenericDevice->szDeviceName, szDeviceName, 16); /* identify the type of of the device */ if (HIL_TRANSPORT_TYPE_KEEP_ALIVE != (usTLType = HilTransportGetDefaultTLType(hTransport))) --- OS_Dependent.h Tue Oct 08 09:31:00 2013 +++ OS_Dependent.h Tue Oct 08 08:29:16 2013 @@ -74,10 +74,10 @@ int OS_Strcmp(const char* pszBuf1, const char* pszBuf2); int OS_Strnicmp(const char* pszBuf1, const char* pszBuf2, uint32_t ulLen); int OS_Strlen(const char* szText); -char* OS_Strncpy(char* szDest, uint32_t ulDstSize, const char* szSource, uint32_t ulLen); +char* OS_Strncpy(char* szDest, const char* szSource, uint32_t ulLen); char* OS_Strvsprintf(char *szDest, uint32_t ulSize, const char *format, ...); uint32_t OS_Strcspn( char* szSearchStr, char* szFindStr); -char* OS_Strcat(char* szDest, uint32_t ulDstSize, char* szSrc); +char* OS_Strncat(char* szDest, char* szSrc, uint32_t ulDstSize); #ifdef NXT_MULTITHREADED int32_t OS_CreateThread( void* pvUserParam, uint32_t ulParamSize); --- TL_Marshaller.c Tue Oct 08 09:31:00 2013 +++ TL_Marshaller.c Tue Oct 08 08:26:38 2013 @@ -2998,7 +2998,7 @@ ptTLInfo->atMarshallerEndpoints = OS_Memrealloc( ptTLInfo->atMarshallerEndpoints, (ptTLInfo->ulEndpointCounter+1)*sizeof(ptEndpoint)); ptTLInfo->atMarshallerEndpoints[ptTLInfo->ulEndpointCounter++] = ptEndpoint; - OS_Strncpy( szDeviceName, 16, tBoardInfo.abBoardName, 16); + OS_Strncpy( szDeviceName, tBoardInfo.abBoardName, 16); /* unique device identification -> to be able to identify a reconnected device */ /* (the identifier needs to be unique per interface, so we can use the physical address */ --- TL_rcXPacket.c Tue Oct 08 09:31:00 2013 +++ TL_rcXPacket.c Tue Oct 08 08:26:33 2013 @@ -574,7 +574,6 @@ ptDirListReq->tData.usDirNameLength = usDirNameLength; OS_Strncpy((char*)((&ptDirListReq->tData) + 1), - usDirNameLength, ptDirectoryInfo->szFilename, usDirNameLength); } @@ -599,7 +598,6 @@ /* TODO: Store handle for directory list, which needs to be set by firmware */ ptDirectoryInfo->hList = (void*)1; OS_Strncpy( ptDirectoryInfo->szFilename, - sizeof(ptDirectoryInfo->szFilename), ptDirListCnf->tData.szName, sizeof(ptDirectoryInfo->szFilename)); @@ -639,7 +637,6 @@ /* NOTE: We ignore the RecvCallback functions pointer, cause we don't receive a async packet */ ptDirListReq->tData.usDirNameLength = usDirNameLen; OS_Strncpy( (char*)((&ptDirListReq->tData) + 1), - usDirNameLen, ptDirectoryInfo->szFilename, usDirNameLen); @@ -671,7 +668,6 @@ } else { OS_Strncpy(ptDirectoryInfo->szFilename, - sizeof(ptDirListCnf->tData.szName), ptDirListCnf->tData.szName, sizeof(ptDirListCnf->tData.szName)); @@ -2479,9 +2475,8 @@ /* get device name */ OS_Strncpy( ptChannelInfo->abBoardName, - sizeof(ptChannelInfo->abBoardName), ptTLInfo->tDevice.szDevicename, - OS_Strlen(ptTLInfo->tDevice.szDevicename)); /* Global board name */ + sizeof(ptChannelInfo->abBoardName)); /* Global board name */ ptChannelInfo->ulDeviceNumber = ptTLInfo->tDevice.tSystemInfo.ulDeviceNumber; /* Global board device number */ ptChannelInfo->ulSerialNumber = ptTLInfo->tDevice.tSystemInfo.ulSerialNumber; /* Global board serial number */ @@ -2627,7 +2622,7 @@ /* since this translation layer supports only one device per interface, we can set the device private data to the global translation layer data */ *ppvPrivateData = ptTLDevInfo; - OS_Strncpy( szDeviceName, 16, "cifX0", 16); + OS_Strncpy( szDeviceName, "cifX0", 16); if (NULL == ptTLDevInfo) {