Use ast_copy_string() instead of strncpy(), and use sizeof() instead of

a magic number


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Russell Bryant 17 years ago
parent 0db8a98efe
commit 71173779dc

@ -3623,8 +3623,11 @@ static struct ast_context *find_context_locked(const char *context)
{
struct ast_context *c = NULL;
struct fake_context item;
strncpy(item.name, context, 256);
ast_copy_string(item.name, context, sizeof(item.name));
ast_rdlock_contexts();
c = ast_hashtab_lookup(contexts_tree,&item);
#ifdef NOTNOW

Loading…
Cancel
Save