Closed
Bug 1121970
Opened 10 years ago
Closed 10 years ago
debug output from printf_stderr gets clipped on Windows
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: jimm, Assigned: jimm)
Details
Attachments
(1 file, 1 obsolete file)
1.47 KB,
patch
|
Details | Diff | Splinter Review |
![]() |
Assignee | |
Comment 1•10 years ago
|
||
![]() |
Assignee | |
Updated•10 years ago
|
Attachment #8550255 -
Flags: review?(benjamin)
Comment 2•10 years ago
|
||
Comment on attachment 8550255 [details] [diff] [review]
patch
Please at least use nsAutoArrayPtr<char> instead of the manual new/delete. I feel like there has to be a better way here, but I'm not thinking of it offhand.
Attachment #8550255 -
Flags: review?(benjamin) → review?(nfroyd)
![]() |
||
Comment 3•10 years ago
|
||
Comment on attachment 8550255 [details] [diff] [review]
patch
Review of attachment 8550255 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the changes below.
::: xpcom/glue/nsCRTGlue.cpp
@@ +340,5 @@
> if (IsDebuggerPresent()) {
> + int lengthNeeded = _vscprintf(aFmt, aArgs);
> + if (lengthNeeded) {
> + lengthNeeded++;
> + char* buf = new char[lengthNeeded];
Please use mozilla::UniquePtr (mozilla/UniquePtr.h) here. Bonus points if you use MakeUnique:
auto buf = MakeUnique<char[]>(lengthNeeded);
@@ +348,5 @@
> + vsnprintf(buf, lengthNeeded, aFmt, argsCpy);
> + buf[lengthNeeded - 1] = '\0';
> + va_end(argsCpy);
> + OutputDebugStringA(buf);
> + delete [] buf;
...and then you don't need this.
@@ +350,5 @@
> + va_end(argsCpy);
> + OutputDebugStringA(buf);
> + delete [] buf;
> + }
> + }
Nit: trailing whitespace.
Attachment #8550255 -
Flags: review?(nfroyd) → review+
![]() |
Assignee | |
Comment 4•10 years ago
|
||
![]() |
Assignee | |
Comment 5•10 years ago
|
||
Attachment #8550255 -
Attachment is obsolete: true
![]() |
Assignee | |
Updated•10 years ago
|
Keywords: checkin-needed
Comment 6•10 years ago
|
||
Keywords: checkin-needed
Comment 7•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•