VirtualBox

Changeset 9994 in vbox


Ignore:
Timestamp:
Jun 27, 2008 1:16:26 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32445
Message:

Additions/common: clean up mode reading code in VBoxGuestR3LibVideo.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r9920 r9994  
    294294        /* Extract the width from the string */
    295295        rc = RTStrToUInt32Ex(szModeParms, &pszNext, 10, &cx);
    296     if (   (VWRN_NUMBER_TOO_BIG == rc)
    297         || (VWRN_NEGATIVE_UNSIGNED == rc)
    298         || (RT_SUCCESS(rc) && (*pszNext != ',') && (*pszNext != 'x')))
     296    if ((rc != VWRN_TRAILING_CHARS) || (*pszNext != 'x'))
    299297        rc = VERR_INVALID_PARAMETER;
    300298    if (RT_SUCCESS(rc))
    301299    {
    302         if ((*pszNext != ',') || (*pszNext != 'x'))
    303             ++pszNext;
    304         for (;' ' == *pszNext; ++pszNext);
     300        ++pszNext;
    305301        rc = RTStrToUInt32Ex(pszNext, &pszNext, 10, &cy);
    306302    }
    307     if (   (VWRN_NUMBER_TOO_BIG == rc)
    308         || (VWRN_NEGATIVE_UNSIGNED == rc)
    309         || (RT_SUCCESS(rc) && (*pszNext != ',') && (*pszNext != 'x')))
     303    if ((rc != VWRN_TRAILING_CHARS) || (*pszNext != 'x'))
    310304        rc = VERR_INVALID_PARAMETER;
    311305    if (RT_SUCCESS(rc))
    312306    {
    313         if ((*pszNext != ',') || (*pszNext != 'x'))
    314             ++pszNext;
    315         for (;' ' == *pszNext; ++pszNext);
    316         rc = RTStrToUInt32Ex(pszNext, &pszNext, 10, &cBits);
    317     }
    318     if (   (VWRN_NUMBER_TOO_BIG == rc)
    319         || (VWRN_NEGATIVE_UNSIGNED == rc)
    320         || (VWRN_TRAILING_CHARS == rc))
     307        ++pszNext;
     308        rc = RTStrToUInt32Full(pszNext, 10, &cBits);
     309    }
     310    if (rc != VINF_SUCCESS)
    321311        rc = VERR_INVALID_PARAMETER;
    322312    if (u32ClientId != 0)
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