VirtualBox

Ignore:
Timestamp:
Nov 16, 2010 4:38:55 PM (14 years ago)
Author:
vboxsync
Message:

Main: use safer string functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/BusAssignmentManager.cpp

    r34044 r34123  
    2020
    2121#include <iprt/asm.h>
     22#include <iprt/string.h>
    2223
    2324#include <VBox/cfgm.h>
     
    218219        PciDeviceRecord(const char* pszName)
    219220        {
    220             ::strncpy(szDevName, pszName, sizeof(szDevName));
     221            RTStrCopy(szDevName, sizeof(szDevName), pszName);
    221222        }
    222223
    223224        bool operator<(const PciDeviceRecord &a) const
    224225        {
    225             return ::strcmp(szDevName, a.szDevName) < 0;
     226            return RTStrNCmp(szDevName, a.szDevName, sizeof(szDevName)) < 0;
    226227        }
    227228
    228229        bool operator==(const PciDeviceRecord &a) const
    229230        {
    230             return ::strcmp(szDevName, a.szDevName) == 0;
     231            return RTStrNCmp(szDevName, a.szDevName, sizeof(szDevName)) == 0;
    231232        }
    232233    };
     
    325326        for (iRule = 0; aArrays[iRuleset][iRule].pszName != NULL; iRule++)
    326327        {
    327             if (strcmp(pszName, aArrays[iRuleset][iRule].pszName) == 0)
     328            if (RTStrCmp(pszName, aArrays[iRuleset][iRule].pszName) == 0)
    328329                aList.push_back(&aArrays[iRuleset][iRule]);
    329330        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette