Make sure time is valid for uptime (bug 1214)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
James Golovich 21 years ago
parent 044aa4fa60
commit 51f004494a

@ -186,6 +186,8 @@ static char *format_uptimestr(time_t timeval)
#define WEEK (DAY*7)
#define YEAR (DAY*365)
if (timeval < 0)
return NULL;
if (timeval > YEAR) {
years = (timeval / YEAR);
timeval -= (years * YEAR);

Loading…
Cancel
Save