Index: apps/app_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_agi.c,v retrieving revision 1.43 diff -u -p -r1.43 app_agi.c --- apps/app_agi.c 22 Jun 2004 19:32:52 -0000 1.43 +++ apps/app_agi.c 13 Jul 2004 20:03:43 -0000 @@ -1135,15 +1135,18 @@ static agi_command commands[] = { { { "set", "music", NULL }, handle_setmusic, "Enable/Disable Music on hold generator", usage_setmusic } }; -static void join(char *s, int len, char *w[]) +static void join(char *s, size_t len, char *w[]) { int x; /* Join words into a string */ - strcpy(s, ""); + if (!s) { + return; + } + s[0] = '\0'; for (x=0;w[x];x++) { if (x) - strncat(s, " ", len - strlen(s)); - strncat(s, w[x], len - strlen(s)); + strncat(s, " ", len - strlen(s) - 1); + strncat(s, w[x], len - strlen(s) - 1); } }