Bug 799156 - normalize_struct_tm() does not normalize seconds,...

minutes, and hours correctly.

Fix proposed by Sherlock.
pull/1836/head
John Ralls 2 years ago
parent 5005c3cac8
commit 966cef19aa

@ -126,7 +126,7 @@ gnc_localtime_r (const time64 *secs, struct tm* time)
}
static void
normalize_time_component (int *inner, int *outer, unsigned int divisor,
normalize_time_component (int *inner, int *outer, int divisor,
int base)
{
while (*inner < base)
@ -134,7 +134,7 @@ normalize_time_component (int *inner, int *outer, unsigned int divisor,
--(*outer);
*inner += divisor;
}
while (*inner > static_cast<gint>(divisor))
while (*inner >= divisor + base)
{
++(*outer);
*inner -= divisor;

Loading…
Cancel
Save