VirtualBox

Changeset 51790 in vbox for trunk/src


Ignore:
Timestamp:
Jul 1, 2014 8:32:22 PM (11 years ago)
Author:
vboxsync
Message:

Better fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/base64.cpp

    r51788 r51790  
    232232    uint8_t     u8Trio[3] = { 0, 0, 0 }; /* shuts up gcc */
    233233    uint8_t    *pbData    = (uint8_t *)pvData;
     234    unsigned    ch;
    234235    uint8_t     u8;
    235236    unsigned    c6Bits    = 0;
     
    239240    {
    240241        /* The first 6-bit group. */
    241         while ((u8 = cchStringMax > 0 ? g_au8CharToVal[*pszString] : BASE64_INVALID) == BASE64_SPACE)
     242        while ((u8 = g_au8CharToVal[ch = cchStringMax > 0 ? *pszString : 0]) == BASE64_SPACE)
    242243            pszString++, cchStringMax--;
    243244        if (u8 >= 64)
     
    251252
    252253        /* The second 6-bit group. */
    253         while ((u8 = cchStringMax > 0 ? g_au8CharToVal[*pszString] : BASE64_INVALID) == BASE64_SPACE)
     254        while ((u8 = g_au8CharToVal[ch = cchStringMax > 0 ? *pszString : 0]) == BASE64_SPACE)
    254255            pszString++, cchStringMax--;
    255256        if (u8 >= 64)
     
    265266        /* The third 6-bit group. */
    266267        u8 = BASE64_INVALID;
    267         while ((u8 = cchStringMax > 0 ? g_au8CharToVal[*pszString] : BASE64_INVALID) == BASE64_SPACE)
     268        while ((u8 = g_au8CharToVal[ch = cchStringMax > 0 ? *pszString : 0]) == BASE64_SPACE)
    268269            pszString++, cchStringMax--;
    269270        if (u8 >= 64)
     
    279280        /* The fourth 6-bit group. */
    280281        u8 = BASE64_INVALID;
    281         while ((u8 = cchStringMax > 0 ? g_au8CharToVal[*pszString] : BASE64_INVALID) == BASE64_SPACE)
     282        while ((u8 = g_au8CharToVal[ch = cchStringMax > 0 ? *pszString : 0]) == BASE64_SPACE)
    282283            pszString++, cchStringMax--;
    283284        if (u8 >= 64)
     
    305306     */
    306307    unsigned cbPad = 0;
    307     unsigned ch = 0;
    308308    if (u8 == BASE64_PAD)
    309309    {
     
    326326            return VERR_INVALID_BASE64_ENCODING;
    327327    }
    328     else if (cchStringMax > 0)
    329         ch = *pszString;
    330328
    331329    /*
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