Update clock.c

fix for integer overflow issue.