summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-01-28 04:30:44 +0000
committerRussell Bryant <russell@russellbryant.com>2008-01-28 04:30:44 +0000
commite8f7cbf3582b9cd97d03cc8a0622070a66b1dccc (patch)
tree8a6237e1cdc60fb6e5da3a9a9bf2f204df92ca66 /main
parent79be2b8b0e414cb8ffd0e9d4929ec5cf9fbde66d (diff)
- Simplify a line with ARRAY_LEN()
- Make a few little formatting changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/channel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/channel.c b/main/channel.c
index e818b8afc..cfd041819 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -4561,14 +4561,14 @@ void ast_moh_cleanup(struct ast_channel *chan)
void ast_channels_init(void)
{
- ast_cli_register_multiple(cli_channel, sizeof(cli_channel) / sizeof(struct ast_cli_entry));
+ ast_cli_register_multiple(cli_channel, ARRAY_LEN(cli_channel));
}
/*! \brief Print call group and pickup group ---*/
char *ast_print_group(char *buf, int buflen, ast_group_t group)
{
unsigned int i;
- int first=1;
+ int first = 1;
char num[3];
buf[0] = '\0';
@@ -4581,7 +4581,7 @@ char *ast_print_group(char *buf, int buflen, ast_group_t group)
if (!first) {
strncat(buf, ", ", buflen);
} else {
- first=0;
+ first = 0;
}
snprintf(num, sizeof(num), "%u", i);
strncat(buf, num, buflen);
@@ -4619,9 +4619,12 @@ static int silence_generator_generate(struct ast_channel *chan, void *data, int
.samples = samples,
.datalen = sizeof(buf),
};
+
memset(buf, 0, sizeof(buf));
+
if (ast_write(chan, &frame))
return -1;
+
return 0;
}