VirtualBox

Ignore:
Timestamp:
Mar 28, 2017 12:48:56 PM (8 years ago)
Author:
vboxsync
Message:

strformatrt.cpp: Reduced the ring-0 address code a little.

File:
1 edited

Legend:

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

    r66299 r66300  
    476476                 * For now don't show the address.
    477477                 */
    478                 cch = 0;
    479478                if (fFlags & RTSTR_F_OBFUSCATE_PTR)
    480479                {
     480# if R0_ARCH_BITS == 64
     481                    static const char s_szObfuscated[] = "0xXXXXXXXX";
     482# else
     483                    static const char s_szObfuscated[] = "0xXXXXXXXXXXXXXXXX";
     484# endif
    481485                    if (fFlags & RTSTR_F_SPECIAL)
    482                         cch += pfnOutput(pvArgOutput, RT_STR_TUPLE("0x"));
    483 
    484 # if R0_ARCH_BITS == 32
    485                     cch += pfnOutput(pvArgOutput, RT_STR_TUPLE("XXXXXXXX"));
    486 # elif R0_ARCH_BITS == 64
    487                     cch += pfnOutput(pvArgOutput, RT_STR_TUPLE("XXXXXXXXXXXXXXXX"));
    488 # else
    489 #  error implement me!
    490 # endif
    491                     return cch;
     486                        return pfnOutput(pvArgOutput, s_szObfuscated, sizeof(s_szObfuscated) - 1);
     487                    return pfnOutput(pvArgOutput, &s_szObfuscated[2], sizeof(s_szObfuscated) - 1 - 2);
    492488                }
    493489#endif
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