Closed Bug 522992 Opened 15 years ago Closed 15 years ago

NSPR logging timestamp month number is off by one

Categories

(NSPR :: NSPR, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: World, Assigned: wtc)

Details

Attachments

(1 file)

[Build Id]
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091018 Minefield/3.7a1pre (.NET CLR 3.5.30729)

Following is first NSPR log line with all:5,timestamp. NSPR log was taken at 2009/10/19 09:04 +0900 (JST).
> 2009-09-19 00:04:36.221000 UTC - 0[833140]: Loaded library Executable (init)
JavaScript is used and "0 to 11" for month of Date object is directly used?
The complaint is that the date which appeared in the log bore the month number
09, when it should have been 10.
Summary: timestamp of NSPR logging produces log of previous month → NSPR logging timestamp month number is off by one
Wada, thanks for the bug report.  This bug is easy to fix.  Just
add 1 to now.tm_month here:

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/nsprpub/pr/src/io/prlog.c&rev=3.50&mark=459#455

Could you write a patch and test it?  Thanks.
Target Milestone: --- → 4.8.3
Sorry but I can't write patch, although I can guess "now.tm_month -> ++now.tm_month" will solve problem.
Just change
  now.tm_month
to
  now.tm_month + 1
Attached patch A patchSplinter Review
Created a trivial path. Sorry for my fault.
Comment on attachment 407204 [details] [diff] [review]
A patch

r=wtc.  Thank you, Hiroyuki.
Attachment #407204 - Flags: review+
I checked in the patch on the NSPR trunk (NSPR 4.8.3).

Checking in pr/src/io/prlog.c;
/cvsroot/mozilla/nsprpub/pr/src/io/prlog.c,v  <--  prlog.c
new revision: 3.51; previous revision: 3.50
done
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: