Skip to content

Commit 966cef1

Browse files
committed
Bug 799156 - normalize_struct_tm() does not normalize seconds,...
minutes, and hours correctly. Fix proposed by Sherlock.
1 parent 5005c3c commit 966cef1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libgnucash/engine/gnc-date.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ gnc_localtime_r (const time64 *secs, struct tm* time)
126126
}
127127

128128
static void
129-
normalize_time_component (int *inner, int *outer, unsigned int divisor,
129+
normalize_time_component (int *inner, int *outer, int divisor,
130130
int base)
131131
{
132132
while (*inner < base)
133133
{
134134
--(*outer);
135135
*inner += divisor;
136136
}
137-
while (*inner > static_cast<gint>(divisor))
137+
while (*inner >= divisor + base)
138138
{
139139
++(*outer);
140140
*inner -= divisor;

0 commit comments

Comments
 (0)