minor fixes to conform to the newly-posted coding guideline :-)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent ac4ac37df1
commit 9e12e429f6

17
cdr.c

@ -147,19 +147,20 @@ void ast_cdr_unregister(char *name)
AST_LIST_UNLOCK(&be_list);
}
static struct ast_cdr *ast_cdr_dup(struct ast_cdr *cdr)
static struct ast_cdr *cdr_dup(struct ast_cdr *cdr)
{
struct ast_cdr *newcdr = NULL;
struct ast_cdr *newcdr;
if (!(newcdr = ast_cdr_alloc())) {
ast_log(LOG_ERROR, "Memory Error!\n");
} else {
memcpy(newcdr,cdr,sizeof(struct ast_cdr));
/* The varshead is unusable, volatile even, after the memcpy so we take care of that here */
memset(&newcdr->varshead, 0, sizeof(newcdr->varshead));
ast_cdr_copy_vars(newcdr, cdr);
return NULL;
}
memcpy(newcdr, cdr, sizeof(*newcdr));
/* The varshead is unusable, volatile even, after the memcpy so we take care of that here */
memset(&newcdr->varshead, 0, sizeof(newcdr->varshead));
ast_cdr_copy_vars(newcdr, cdr);
return newcdr;
}
@ -822,7 +823,7 @@ void ast_cdr_reset(struct ast_cdr *cdr, int flags)
if (ast_test_flag(&tmp, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
if (ast_test_flag(&tmp, AST_CDR_FLAG_POSTED)) {
ast_cdr_end(cdr);
if ((dup = ast_cdr_dup(cdr))) {
if ((dup = cdr_dup(cdr))) {
ast_cdr_detach(dup);
}
ast_set_flag(cdr, AST_CDR_FLAG_POSTED);

Loading…
Cancel
Save