VirtualBox

Ignore:
Timestamp:
Aug 29, 2018 7:32:50 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Bug fixes. Pet listing works. bugref:9167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp

    r73965 r73968  
    310310
    311311    if (a_idx == ~(size_t)0)
    312         a_idx = m_cElements - 1;
     312        a_idx = m_cElements;
    313313
    314314    if (a_idx <= m_cElements)
     
    333333            m_papElements[a_idx] = a_pValue;
    334334            m_cElements++;
    335         }
    336         else
    337         {
    338             /* Replace element. */
    339             delete m_papElements[a_idx];
    340             m_papElements[a_idx] = a_pValue;
    341             return VWRN_ALREADY_EXISTS;
    342         }
     335            return VINF_SUCCESS;
     336        }
     337
     338        /* Replace element. */
     339        delete m_papElements[a_idx];
     340        m_papElements[a_idx] = a_pValue;
     341        return VWRN_ALREADY_EXISTS;
    343342    }
    344343    return VERR_OUT_OF_RANGE;
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