Closed
Bug 261145
Opened 20 years ago
Closed 8 years ago
nsPrintfCString should not truncate long result strings
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 743056
People
(Reporter: vlad, Unassigned)
Details
The (const char *format, ...) nsPrintfCString constructor is almost entirely worthless -- it initializes the internal buffer to the default string size (16 bytes), and then calls PR_snprintf with that fixed size. It would be much more useful and would make more sense if it were to calculate the amount of space needed for the formatted string and DTRT.
Comment 1•20 years ago
|
||
it would be nice if we could avoid heap allocations in every invocation, but maybe that's just what we should do :-/ of course when given a size argument, it should continue to truncate.
Summary: nsPrintfCString constructor is useless → nsPrintfCString should not truncate long result strings
I thought I filed a bug somewhere on making it us PR_smprintf and having a PrintfString that uses nsTextFormatter (not nsTextFormater! :-).
Updated•15 years ago
|
Assignee: string → nobody
QA Contact: string
Comment 3•8 years ago
|
||
IIUC, the landed patch in Bug 743056 should have fixed this. Feel free to re-open if this is not the case.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•3 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•