mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 799156 - normalize_struct_tm() does not normalize seconds,...
minutes, and hours correctly. Fix proposed by Sherlock.
This commit is contained in:
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…
Reference in New Issue
Block a user