Simplify sig_pri.c:build_status().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett 2011-04-21 22:42:41 +00:00
parent c2676dc9dc
commit 13e925b276
1 changed files with 4 additions and 12 deletions

View File

@ -8668,18 +8668,10 @@ static void build_status(char *s, size_t len, int status, int active)
if (!s || len < 1) { if (!s || len < 1) {
return; return;
} }
s[0] = '\0'; snprintf(s, len, "%s%s, %s",
if (!(status & DCHAN_NOTINALARM)) (status & DCHAN_NOTINALARM) ? "" : "In Alarm, ",
strncat(s, "In Alarm, ", len - strlen(s) - 1); (status & DCHAN_UP) ? "Up" : "Down",
if (status & DCHAN_UP) (active) ? "Active" : "Standby");
strncat(s, "Up", len - strlen(s) - 1);
else
strncat(s, "Down", len - strlen(s) - 1);
if (active)
strncat(s, ", Active", len - strlen(s) - 1);
else
strncat(s, ", Standby", len - strlen(s) - 1);
s[len - 1] = '\0';
} }
void sig_pri_cli_show_spans(int fd, int span, struct sig_pri_span *pri) void sig_pri_cli_show_spans(int fd, int span, struct sig_pri_span *pri)