VirtualBox

Changeset 27477 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 18, 2010 12:17:32 PM (15 years ago)
Author:
vboxsync
Message:

VMDK: No need to update the line if cb is 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r27476 r27477  
    24682468        if (cbLimit && uOffset + cb + 1 > cbLimit)
    24692469            return vmdkError(pImage, VERR_BUFFER_OVERFLOW, RT_SRC_POS, N_("VMDK: descriptor too long in '%s'"), pImage->pszFilename);
    2470         rc = vmdkFileWriteAt(pDescFile, uOffset, psz, cb, NULL);
    2471         if (RT_FAILURE(rc))
    2472             return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
    2473         uOffset += cb;
     2470
     2471        if (cb > 0)
     2472        {
     2473            rc = vmdkFileWriteAt(pDescFile, uOffset, psz, cb, NULL);
     2474            if (RT_FAILURE(rc))
     2475                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
     2476            uOffset += cb;
     2477        }
     2478
    24742479        rc = vmdkFileWriteAt(pDescFile, uOffset, "\n", 1, NULL);
    24752480        if (RT_FAILURE(rc))
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