mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Use ast_strlen_zero in file.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
file.c
7
file.c
@@ -19,6 +19,7 @@
|
|||||||
#include <asterisk/sched.h>
|
#include <asterisk/sched.h>
|
||||||
#include <asterisk/options.h>
|
#include <asterisk/options.h>
|
||||||
#include <asterisk/translate.h>
|
#include <asterisk/translate.h>
|
||||||
|
#include <asterisk/utils.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.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 */
|
/* do this first, otherwise we detect the wrong writeformat */
|
||||||
if (chan->generator)
|
if (chan->generator)
|
||||||
ast_deactivate_generator(chan);
|
ast_deactivate_generator(chan);
|
||||||
if (preflang && strlen(preflang)) {
|
if (preflang && !ast_strlen_zero(preflang)) {
|
||||||
strncpy(filename3, filename, sizeof(filename3) - 1);
|
strncpy(filename3, filename, sizeof(filename3) - 1);
|
||||||
endpart = strrchr(filename3, '/');
|
endpart = strrchr(filename3, '/');
|
||||||
if (endpart) {
|
if (endpart) {
|
||||||
@@ -493,7 +494,7 @@ struct ast_filestream *ast_openvstream(struct ast_channel *chan, char *filename,
|
|||||||
char lang2[MAX_LANGUAGE];
|
char lang2[MAX_LANGUAGE];
|
||||||
/* XXX H.263 only XXX */
|
/* XXX H.263 only XXX */
|
||||||
char *fmt = "h263";
|
char *fmt = "h263";
|
||||||
if (preflang && strlen(preflang)) {
|
if (preflang && !ast_strlen_zero(preflang)) {
|
||||||
snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename);
|
snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename);
|
||||||
fmts = ast_fileexists(filename2, fmt, NULL);
|
fmts = ast_fileexists(filename2, fmt, NULL);
|
||||||
if (fmts < 1) {
|
if (fmts < 1) {
|
||||||
@@ -678,7 +679,7 @@ int ast_fileexists(char *filename, char *fmt, char *preflang)
|
|||||||
char *c;
|
char *c;
|
||||||
char lang2[MAX_LANGUAGE];
|
char lang2[MAX_LANGUAGE];
|
||||||
int res = -1;
|
int res = -1;
|
||||||
if (preflang && strlen(preflang)) {
|
if (preflang && !ast_strlen_zero(preflang)) {
|
||||||
/* Insert the language between the last two parts of the path */
|
/* Insert the language between the last two parts of the path */
|
||||||
strncpy(tmp, filename, sizeof(tmp) - 1);
|
strncpy(tmp, filename, sizeof(tmp) - 1);
|
||||||
c = strrchr(tmp, '/');
|
c = strrchr(tmp, '/');
|
||||||
|
Reference in New Issue
Block a user