diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-10 22:56:21 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-10 22:56:21 +0000 |
commit | 9690f518f5b644b670f4e8e047083535c106dafa (patch) | |
tree | 922450cc41923990ec190243f4948def77780abf /astmm.c | |
parent | cd6f09bb95479166e8a62538b941e9e5daa3394e (diff) |
more ast_copy_string conversions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6073 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'astmm.c')
-rwxr-xr-x | astmm.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,7 +1,7 @@ /* * Asterisk -- A telephony toolkit for Linux. * - * Channel Variables + * Memory Management * * Copyright (C) 2002-2005, Mark Spencer * @@ -73,9 +73,9 @@ static inline void *__ast_alloc_region(size_t size, int which, const char *file, reg = malloc(size + sizeof(struct ast_region)); ast_mutex_lock(®lock); if (reg) { - strncpy(reg->file, file, sizeof(reg->file) - 1); + ast_copy_string(reg->file, file, sizeof(reg->file)); reg->file[sizeof(reg->file) - 1] = '\0'; - strncpy(reg->func, func, sizeof(reg->func) - 1); + ast_copy_string(reg->func, func, sizeof(reg->func)); reg->func[sizeof(reg->func) - 1] = '\0'; reg->lineno = lineno; reg->len = size; @@ -305,7 +305,7 @@ static int handle_show_memory_summary(int fd, int argc, char *argv[]) if (!cur) { cur = alloca(sizeof(struct file_summary)); memset(cur, 0, sizeof(struct file_summary)); - strncpy(cur->fn, fn ? reg->func : reg->file, sizeof(cur->fn) - 1); + ast_copy_string(cur->fn, fn ? reg->func : reg->file, sizeof(cur->fn)); cur->next = list; list = cur; } |