diff options
author | Jan Altenberg <[email protected]> | 2008-09-02 14:36:05 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2008-09-02 19:21:40 -0700 |
commit | 73442daf2ea85e2a779396b76b1a39b10188ecb5 (patch) | |
tree | 5705d69476b29890cd39ea3efdc8de68f38daebc /net/unix/sysctl_net_unix.c | |
parent | b4a49b12e879ce79f495cc318c4b33caec6922e8 (diff) |
rtc_time_to_tm: fix signed/unsigned arithmetic
commit 945185a69daa457c4c5e46e47f4afad7dcea734f ("rtc: rtc_time_to_tm: use
unsigned arithmetic") changed the some types in rtc_time_to_tm() to
unsigned:
void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
{
- register int days, month, year;
+ unsigned int days, month, year;
This doesn't work for all cases, because days is checked for < 0 later
on:
if (days < 0) {
year -= 1;
days += 365 + LEAP_YEAR(year);
}
I think the correct fix would be to keep days signed and do an appropriate
cast later on.
Signed-off-by: Jan Altenberg <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Dmitri Vorobiev <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions