VirtualBox

Ignore:
Timestamp:
Oct 26, 2010 12:27:50 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67055
Message:

*: Fixes for incorrect RTStrAPrintf usage (it does NOT return an IPRT status code) and the odd bugs nearby.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r33056 r33464  
    10451045AttributeNode* ElementNode::setAttribute(const char *pcszName, int32_t i)
    10461046{
    1047     char *psz = NULL;
    1048     RTStrAPrintf(&psz, "%RI32", i);
    1049     AttributeNode *p = setAttribute(pcszName, psz);
    1050     RTStrFree(psz);
     1047    char szValue[64];
     1048    RTStrPrintf(szValue, sizeof(szValue), "%RI32", i);
     1049    AttributeNode *p = setAttribute(pcszName, szValue);
    10511050    return p;
    10521051}
    10531052
    1054 AttributeNode* ElementNode::setAttribute(const char *pcszName, uint32_t i)
    1055 {
    1056     char *psz = NULL;
    1057     RTStrAPrintf(&psz, "%RU32", i);
    1058     AttributeNode *p = setAttribute(pcszName, psz);
    1059     RTStrFree(psz);
     1053AttributeNode* ElementNode::setAttribute(const char *pcszName, uint32_t u)
     1054{
     1055    char szValue[64];
     1056    RTStrPrintf(szValue, sizeof(szValue), "%RU32", u);
     1057    AttributeNode *p = setAttribute(pcszName, szValue);
    10601058    return p;
    10611059}
     
    10631061AttributeNode* ElementNode::setAttribute(const char *pcszName, int64_t i)
    10641062{
    1065     char *psz = NULL;
    1066     RTStrAPrintf(&psz, "%RI64", i);
    1067     AttributeNode *p = setAttribute(pcszName, psz);
    1068     RTStrFree(psz);
     1063    char szValue[64];
     1064    RTStrPrintf(szValue, sizeof(szValue), "%RI64", i);
     1065    AttributeNode *p = setAttribute(pcszName, szValue);
    10691066    return p;
    10701067}
    10711068
    1072 AttributeNode* ElementNode::setAttribute(const char *pcszName, uint64_t i)
    1073 {
    1074     char *psz = NULL;
    1075     RTStrAPrintf(&psz, "%RU64", i);
    1076     AttributeNode *p = setAttribute(pcszName, psz);
    1077     RTStrFree(psz);
     1069AttributeNode* ElementNode::setAttribute(const char *pcszName, uint64_t u)
     1070{
     1071    char szValue[64];
     1072    RTStrPrintf(szValue, sizeof(szValue), "%RU64", u);
     1073    AttributeNode *p = setAttribute(pcszName, szValue);
    10781074    return p;
    10791075}
    10801076
    1081 AttributeNode* ElementNode::setAttributeHex(const char *pcszName, uint32_t i)
    1082 {
    1083     char *psz = NULL;
    1084     RTStrAPrintf(&psz, "0x%RX32", i);
    1085     AttributeNode *p = setAttribute(pcszName, psz);
    1086     RTStrFree(psz);
     1077AttributeNode* ElementNode::setAttributeHex(const char *pcszName, uint32_t u)
     1078{
     1079    char szValue[64];
     1080    RTStrPrintf(szValue, sizeof(szValue), "0x%RX32", u);
     1081    AttributeNode *p = setAttribute(pcszName, szValue);
    10871082    return p;
    10881083}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette