SetTime_t: Use the sign-fixed modulo we computed
* 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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user