Skip to content

Commit

Permalink
SetTime_t: Use the sign-fixed modulo we computed
Browse files Browse the repository at this point in the history
* In C++03 and earlier, the sign of the modulo result is implementation
defined (this was fixed in C++11).
* Setting a negative time is not what we want here, so make sure we use
the proper value.
  • Loading branch information
pulkomandy committed Jun 16, 2014
1 parent 2092929 commit dbd4f8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kits/support/DateTime.cpp
Expand Up @@ -1410,7 +1410,7 @@ BDateTime::SetTime_t(time_t seconds)
}

BTime time;
time.AddSeconds(seconds % kSecondsPerDay);
time.AddSeconds(timePart);
fTime.SetTime(time);

BDate date(1970, 1, 1);
Expand Down

0 comments on commit dbd4f8c

Please sign in to comment.