aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_alsa.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-27 02:19:37 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-27 02:19:37 +0000
commitee234bbb3efea571ea7ad138de22f1e010b92ec9 (patch)
tree9f24232bc60be91cb9017aab391d2eff0f4a6341 /channels/chan_alsa.c
parent4cc87ee6e1e0ad07889f178b9c843fdd55d826e8 (diff)
Remove unnecessary checks before calls to ast_strlen_zero. Also, change
some places where strlen is used instead of ast_strlen_zero git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6866 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_alsa.c')
-rwxr-xr-xchannels/chan_alsa.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index 25b251fd4..adbce62eb 100755
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -778,12 +778,12 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
tmp->readformat = AST_FORMAT_SLINEAR;
tmp->writeformat = AST_FORMAT_SLINEAR;
tmp->tech_pvt = p;
- if (strlen(p->context))
- strncpy(tmp->context, p->context, sizeof(tmp->context)-1);
- if (strlen(p->exten))
- strncpy(tmp->exten, p->exten, sizeof(tmp->exten)-1);
- if (strlen(language))
- strncpy(tmp->language, language, sizeof(tmp->language)-1);
+ if (!ast_strlen_zero(p->context))
+ ast_copy_string(tmp->context, p->context, sizeof(tmp->context));
+ if (!ast_strlen_zero(p->exten))
+ ast_copy_string(tmp->exten, p->exten, sizeof(tmp->exten));
+ if (!ast_strlen_zero(language))
+ ast_copy_string(tmp->language, language, sizeof(tmp->language));
p->owner = tmp;
ast_setstate(tmp, state);
ast_mutex_lock(&usecnt_lock);
@@ -851,10 +851,10 @@ static char *autoanswer_complete(char *line, char *word, int pos, int state)
#endif
switch(state) {
case 0:
- if (strlen(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
return strdup("on");
case 1:
- if (strlen(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
return strdup("off");
default:
return NULL;
@@ -1000,9 +1000,9 @@ static int console_dial(int fd, int argc, char *argv[])
stringp=tmp;
strsep(&stringp, "@");
tmp2 = strsep(&stringp, "@");
- if (strlen(tmp))
+ if (!ast_strlen_zero(tmp))
mye = tmp;
- if (tmp2 && strlen(tmp2))
+ if (!ast_strlen_zero(tmp2))
myc = tmp2;
}
if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {