diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-01-13 18:38:55 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-01-13 18:38:55 +0000 |
commit | 55c8fc92a92d0c105e8b09df178ef01421d49152 (patch) | |
tree | 5a94467aed03520611a253029bd57ee366f338e5 /apps/app_queue.c | |
parent | 3928ebd74fdf42efcd44eba179d5950c4ccf2ab8 (diff) |
Various cleanups from comments in an email from Luigi Rizzo. Thank you!
- Use a cleaner syntax for declaring the allocation macros
- Fix return value for ast_strdup/ast_strndup
- remove safe_strdup from app_macro, since ast_strup does the same thing
- fix a place in app_queue where ast_calloc+strncpy was used instead of
ast_strdup. If you are helping out with these conversions, please watch out
for other places where this is done.
- add a note to the coding guidelines about the fix to app_queue
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 669e25d86..06aebe724 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1709,8 +1709,7 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser if (in->cid.cid_ani) { if (o->chan->cid.cid_ani) free(o->chan->cid.cid_ani); - if ((o->chan->cid.cid_ani = ast_calloc(1, strlen(in->cid.cid_ani) + 1))) - strncpy(o->chan->cid.cid_ani, in->cid.cid_ani, strlen(in->cid.cid_ani) + 1); + o->chan->cid.cid_ani = ast_strdup(in->cid.cid_ani); } if (o->chan->cid.cid_rdnis) free(o->chan->cid.cid_rdnis); |