VirtualBox

Changeset 16774 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 15, 2009 4:23:47 AM (16 years ago)
Author:
vboxsync
Message:

RTBase64: no trailing newline.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

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

    r16766 r16774  
    423423
    424424        cch += (cch / RTBASE64_LINE_LEN) * RTBASE64_EOL_SIZE;
     425        cch -= (cch % RTBASE64_LINE_LEN) == 0;
    425426        return cch;
    426427    }
     
    432433
    433434    cch += (cch / RTBASE64_LINE_LEN) * RTBASE64_EOL_SIZE;
     435    cch -= (cch % RTBASE64_LINE_LEN) == 0;
    434436    return cch;
    435437}
     
    485487        pbSrc  += 3;
    486488
    487         if (cbBuf == cbLineFeed)
     489        /* deal out linefeeds */
     490        if (cbBuf == cbLineFeed && cbData)
    488491        {
    489492            if (cbBuf < RTBASE64_EOL_SIZE + 1)
  • trunk/src/VBox/Runtime/testcase/tstBase64.cpp

    r16773 r16774  
    128128    {
    129129        RTPrintf("tstBase64: FAILURE - %s: RTBase64EncodedLength returned %zu bytes, expected %zu.\n",
    130                  szTest, cchOut, cchOut2);
     130                 szTest, cchOut2, cchOut);
    131131        g_cErrors++;
    132132    }
     
    284284        "9P/0//T/9AD0APQA9f/1//X/9QD1APUA9v/2//b/9gD2APYA9//3//f/9wD3APcA" MY_NL
    285285        "+P/4//j/+AD4APgA+f/5//n/+QD5APkA+v/6//r/+gD6APoA+//7//v/+wD7APsA" MY_NL
    286         "/P/8//z//AD8APwA/f/9//3//QD9AP0A/v/+//7//gD+AP4A/////////wD/AP8A" MY_NL;
     286        "/P/8//z//AD8APwA/f/9//3//QD9AP0A/v/+//7//gD+AP4A/////////wD/AP8A";
    287287
    288288    tstBase64(s_abData3, sizeof(s_abData3),
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