NSPR logging timestamp month number is off by one

RESOLVED FIXED in 4.8.3

Status

NSPR
NSPR
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: World, Assigned: Wan-Teh Chang)

Tracking

other
4.8.3
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
[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
(Assignee)

Comment 2

8 years ago
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
(Reporter)

Comment 3

8 years ago
Sorry but I can't write patch, although I can guess "now.tm_month -> ++now.tm_month" will solve problem.
(Assignee)

Comment 4

8 years ago
Just change
  now.tm_month
to
  now.tm_month + 1
Created attachment 407204 [details] [diff] [review]
A patch

Created a trivial path. Sorry for my fault.
(Assignee)

Comment 6

8 years ago
Comment on attachment 407204 [details] [diff] [review]
A patch

r=wtc.  Thank you, Hiroyuki.
Attachment #407204 - Flags: review+
(Assignee)

Comment 7

8 years ago
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
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.