mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
issue #5560
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
2005-11-01 Kevin P. Fleming <kpfleming@digium.com>
|
2005-11-01 Kevin P. Fleming <kpfleming@digium.com>
|
||||||
|
|
||||||
|
* apps/app_cut.c (cut_internal): use ast_separate_app_args() instead of open code (issue #5560)
|
||||||
|
|
||||||
* apps/app_mixmonitor.c (launch_monitor_thread): ast_strlen_zero can handle NULL input (issue #5561)
|
* apps/app_mixmonitor.c (launch_monitor_thread): ast_strlen_zero can handle NULL input (issue #5561)
|
||||||
(mixmonitor_exec): same
|
(mixmonitor_exec): same
|
||||||
|
|
||||||
|
@@ -36,6 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include "asterisk/pbx.h"
|
#include "asterisk/pbx.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/version.h"
|
#include "asterisk/version.h"
|
||||||
|
#include "asterisk/app.h"
|
||||||
|
|
||||||
/* Maximum length of any variable */
|
/* Maximum length of any variable */
|
||||||
#define MAXRESULT 1024
|
#define MAXRESULT 1024
|
||||||
@@ -150,7 +151,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz
|
|||||||
|
|
||||||
static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size_t buflen)
|
static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
char *s, *varname=NULL, *delimiter=NULL, *field=NULL;
|
char *s, *args[3], *varname=NULL, *delimiter=NULL, *field=NULL;
|
||||||
int args_okay = 0;
|
int args_okay = 0;
|
||||||
|
|
||||||
memset(buffer, 0, buflen);
|
memset(buffer, 0, buflen);
|
||||||
@@ -159,15 +160,13 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
|
|||||||
if (data) {
|
if (data) {
|
||||||
s = ast_strdupa((char *)data);
|
s = ast_strdupa((char *)data);
|
||||||
if (s) {
|
if (s) {
|
||||||
varname = strsep(&s, "|");
|
ast_separate_app_args(s, '|', args, 3);
|
||||||
if (varname && (varname[0] != '\0')) {
|
varname = args[0];
|
||||||
delimiter = strsep(&s, "|");
|
delimiter = args[1];
|
||||||
if (delimiter) {
|
field = args[2];
|
||||||
field = strsep(&s, "|");
|
|
||||||
if (field) {
|
if (field) {
|
||||||
args_okay = 1;
|
args_okay = 1;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ERROR_NOMEM;
|
return ERROR_NOMEM;
|
||||||
|
Reference in New Issue
Block a user