VirtualBox

Changeset 17522 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Mar 7, 2009 6:50:52 AM (16 years ago)
Author:
vboxsync
Message:

strformattype.cpp: be a bit more gentle if the type is missing.

File:
1 edited

Legend:

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

    r13832 r17522  
    422422    char const *pszType;
    423423    char        ch;
     424    void       *pvValue = va_arg(*pArgs, void *);
    424425
    425426    /*
     
    454455#endif
    455456        void *pvUser = ASMAtomicReadPtr(&g_aTypes[i].pvUser);
    456         void *pvValue = va_arg(*pArgs, void *);
     457
     458        rtstrFormatTypeReadUnlock();
    457459
    458460        cch = pfnHandler(pfnOutput, pvArgOutput, g_aTypes[i].szType, pvValue, cchWidth, cchPrecision, fFlags, pvUser);
    459461    }
    460462    else
    461         cch = 0;
    462 
    463     rtstrFormatTypeReadUnlock();
    464 
    465     Assert(i >= 0);
     463    {
     464        rtstrFormatTypeReadUnlock();
     465
     466        cch  = pfnOutput(pvArgOutput, "<missing:%R[", sizeof("<missing:%R[") - 1);
     467        cch += pfnOutput(pvArgOutput, pszType, pszTypeEnd - pszType);
     468        cch += pfnOutput(pvArgOutput, "]>", sizeof("]>") - 1);
     469    }
     470
    466471    return cch;
    467472}
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