VirtualBox

Changeset 74824 in vbox for trunk


Ignore:
Timestamp:
Oct 12, 2018 6:47:50 PM (6 years ago)
Author:
vboxsync
Message:

Main: bugref:9152 Implement the convertToStream API [build fix for 32bit hosts]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumIOImpl.cpp

    r74822 r74824  
    268268        do
    269269        {
    270             size_t cbThisWrite = RT_MIN(pStreamFile->cbFile - pStreamFile->uOffsetLast, sizeof(g_abRTZero64K));
     270            size_t cbThisWrite = sizeof(g_abRTZero64K);
    271271            size_t cbWritten = 0;
     272
     273            if (pStreamFile->cbFile - pStreamFile->uOffsetLast < sizeof(g_abRTZero64K))
     274                cbThisWrite = (size_t)(pStreamFile->cbFile - pStreamFile->uOffsetLast);
    272275
    273276            rc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten);
     
    369372        do
    370373        {
    371             size_t cbThisWrite = RT_MIN(uOffset - pStreamFile->uOffsetLast, sizeof(g_abRTZero64K));
     374            size_t cbThisWrite = sizeof(g_abRTZero64K);
    372375            size_t cbWritten = 0;
     376
     377            if (uOffset - pStreamFile->uOffsetLast < sizeof(g_abRTZero64K))
     378                cbThisWrite = (size_t)(uOffset - pStreamFile->uOffsetLast);
    373379
    374380            rc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten);
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