Added parentheses around assignment and type casts for ctime function.