VirtualBox

Changeset 14062 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Nov 10, 2008 11:23:05 PM (16 years ago)
Author:
vboxsync
Message:

RTDirRead/RTDirReadEx: sizes are size_t not unsigned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r13104 r14062  
    240240
    241241
    242 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, unsigned *pcbDirEntry)
     242RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
    243243{
    244244    /*
     
    255255        return VERR_INVALID_PARAMETER;
    256256    }
    257     unsigned cbDirEntry = sizeof(*pDirEntry);
     257    size_t cbDirEntry = sizeof(*pDirEntry);
    258258    if (pcbDirEntry)
    259259    {
    260260        cbDirEntry = *pcbDirEntry;
    261         if (cbDirEntry < (unsigned)RT_OFFSETOF(RTDIRENTRY, szName[2]))
     261        if (cbDirEntry < RT_UOFFSETOF(RTDIRENTRY, szName[2]))
    262262        {
    263263            AssertMsgFailed(("Invalid *pcbDirEntry=%d (min %d)\n", *pcbDirEntry, RT_OFFSETOF(RTDIRENTRY, szName[2])));
     
    336336
    337337
    338 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, unsigned *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
     338RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
    339339{
    340340    /*
     
    357357        return VERR_INVALID_PARAMETER;
    358358    }
    359     unsigned cbDirEntry = sizeof(*pDirEntry);
     359    size_t cbDirEntry = sizeof(*pDirEntry);
    360360    if (pcbDirEntry)
    361361    {
    362362        cbDirEntry = *pcbDirEntry;
    363         if (cbDirEntry < (unsigned)RT_OFFSETOF(RTDIRENTRYEX, szName[2]))
     363        if (cbDirEntry < RT_UOFFSETOF(RTDIRENTRYEX, szName[2]))
    364364        {
    365365            AssertMsgFailed(("Invalid *pcbDirEntry=%d (min %d)\n", *pcbDirEntry, RT_OFFSETOF(RTDIRENTRYEX, szName[2])));
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