Last set of strncpy/snprintf updates (bug #2049)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-07-16 04:40:54 +00:00
parent 78117423fa
commit bba1faf910
17 changed files with 320 additions and 279 deletions

View File

@@ -852,11 +852,11 @@ static int console_sendtext(int fd, int argc, char *argv[])
res = RESULT_FAILURE;
} else {
struct ast_frame f = { AST_FRAME_TEXT, 0 };
char text2send[256];
strcpy(text2send, "");
char text2send[256] = "";
text2send[0] = '\0';
while(tmparg <= argc) {
strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send));
strncat(text2send, " ", sizeof(text2send) - strlen(text2send));
strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
}
f.data = text2send;
f.datalen = strlen(text2send) + 1;