From c94e23b2f6ef1a5ef239e8ddaffc736094fe42af Mon Sep 17 00:00:00 2001 From: James Golovich <james@gnuinter.net> Date: Thu, 6 May 2004 21:17:06 +0000 Subject: [PATCH] Use ast_strlen_zero in file.c git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2911 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file.c b/file.c index 249dd4e1ef..ad80d5272b 100755 --- a/file.c +++ b/file.c @@ -19,6 +19,7 @@ #include <asterisk/sched.h> #include <asterisk/options.h> #include <asterisk/translate.h> +#include <asterisk/utils.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> @@ -444,7 +445,7 @@ struct ast_filestream *ast_openstream(struct ast_channel *chan, char *filename, /* do this first, otherwise we detect the wrong writeformat */ if (chan->generator) ast_deactivate_generator(chan); - if (preflang && strlen(preflang)) { + if (preflang && !ast_strlen_zero(preflang)) { strncpy(filename3, filename, sizeof(filename3) - 1); endpart = strrchr(filename3, '/'); if (endpart) { @@ -493,7 +494,7 @@ struct ast_filestream *ast_openvstream(struct ast_channel *chan, char *filename, char lang2[MAX_LANGUAGE]; /* XXX H.263 only XXX */ char *fmt = "h263"; - if (preflang && strlen(preflang)) { + if (preflang && !ast_strlen_zero(preflang)) { snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename); fmts = ast_fileexists(filename2, fmt, NULL); if (fmts < 1) { @@ -678,7 +679,7 @@ int ast_fileexists(char *filename, char *fmt, char *preflang) char *c; char lang2[MAX_LANGUAGE]; int res = -1; - if (preflang && strlen(preflang)) { + if (preflang && !ast_strlen_zero(preflang)) { /* Insert the language between the last two parts of the path */ strncpy(tmp, filename, sizeof(tmp) - 1); c = strrchr(tmp, '/'); -- GitLab