Fix another CLI command, "core show uptime" ...

(issue #8323, reported by johnlange, fixed by myself)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-11-09 15:49:39 +00:00
parent 15ba13f1ec
commit 0b927d2208

View File

@@ -478,9 +478,9 @@ static int handle_showuptime(int fd, int argc, char *argv[])
{ {
/* 'show uptime [seconds]' */ /* 'show uptime [seconds]' */
time_t curtime = time(NULL); time_t curtime = time(NULL);
int printsec = (argc == 3 && !strcasecmp(argv[2],"seconds")); int printsec = (argc == 4 && !strcasecmp(argv[3],"seconds"));
if (argc != 2 && !printsec) if (argc != 3 && !printsec)
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
if (ast_startuptime) if (ast_startuptime)
print_uptimestr(fd, curtime - ast_startuptime, "System uptime", printsec); print_uptimestr(fd, curtime - ast_startuptime, "System uptime", printsec);