VirtualBox

Ignore:
Timestamp:
Nov 27, 2023 6:48:07 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160481
Message:

libs/xpcom: Replace remaining APIs from prprf.h with IPRT equivalents, bugref:10545

Location:
trunk/src/libs/xpcom18a4/xpcom/string/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/string/src/nsPrintfCString.cpp

    r1 r102345  
    3939#include "nsPrintfCString.h"
    4040#include <stdarg.h>
    41 #include "prprf.h"
    4241
     42#include <iprt/string.h>
    4343
    4444// though these classes define a fixed buffer, they do not set the F_FIXED
     
    5858
    5959    va_start(ap, format);
    60     mLength = PR_vsnprintf(mData, physical_capacity, format, ap);
     60    ssize_t cch = RTStrPrintf2V(mData, physical_capacity, format, ap);
     61    Assert(cch > 0);
     62    mLength = (size_type)cch;
    6163    va_end(ap);
    6264  }
     
    7981
    8082    va_start(ap, format);
    81     mLength = PR_vsnprintf(mData, physical_capacity, format, ap);
     83    ssize_t cch = RTStrPrintf2V(mData, physical_capacity, format, ap);
     84    Assert(cch > 0);
     85    mLength = (size_type)cch;
    8286    va_end(ap);
    8387  }
  • trunk/src/libs/xpcom18a4/xpcom/string/src/nsStringObsolete.cpp

    r102006 r102345  
    5151#include "nsCRT.h"
    5252#include "nsUTF8Utils.h"
    53 #include "prprf.h"
    5453
    5554#include <iprt/assert.h>
     
    11321131        fmt = "%x";
    11331132    }
    1134     PR_snprintf(buf, sizeof(buf), fmt, aInteger);
     1133    RTStrPrintf2(buf, sizeof(buf), fmt, aInteger);
    11351134    Append(buf);
    11361135  }
     
    11521151        fmt = "%x";
    11531152    }
    1154     PR_snprintf(buf, sizeof(buf), fmt, aInteger);
     1153    RTStrPrintf2(buf, sizeof(buf), fmt, aInteger);
    11551154    AppendASCIItoUTF16(buf, *this);
    11561155  }
     
    11721171        fmt = "%llx";
    11731172    }
    1174     PR_snprintf(buf, sizeof(buf), fmt, aInteger);
     1173    RTStrPrintf2(buf, sizeof(buf), fmt, aInteger);
    11751174    Append(buf);
    11761175  }
     
    11921191        fmt = "%llx";
    11931192    }
    1194     PR_snprintf(buf, sizeof(buf), fmt, aInteger);
     1193    RTStrPrintf2(buf, sizeof(buf), fmt, aInteger);
    11951194    AppendASCIItoUTF16(buf, *this);
    11961195  }
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