[Asterisk-cvs] asterisk/apps app_adsiprog.c, 1.12,
1.13 app_alarmreceiver.c, 1.11, 1.12 app_directory.c, 1.38,
1.39 app_macro.c, 1.24, 1.25 app_math.c, 1.11,
1.12 app_setcallerid.c, 1.8, 1.9 app_setcidname.c, 1.9,
1.10 app_setcidnum.c, 1.10, 1.11 app_setrdnis.c, 1.5,
1.6 app_settransfercapability.c, 1.5, 1.6 app_sms.c, 1.23,
1.24 app_talkdetect.c, 1.9, 1.10 app_txtcidname.c, 1.13,
1.14 app_zapras.c, 1.11, 1.12 app_zapscan.c, 1.19, 1.20
russell at lists.digium.com
russell at lists.digium.com
Sun Jul 10 19:04:03 CDT 2005
- Previous message: [Asterisk-cvs] asterisk acl.c, 1.47, 1.48 astmm.c, 1.16,
1.17 callerid.c, 1.33, 1.34 cli.c, 1.89, 1.90 config.c, 1.72,
1.73 enum.c, 1.27, 1.28 frame.c, 1.58, 1.59 logger.c, 1.76,
1.77 manager.c, 1.101, 1.102 privacy.c, 1.6, 1.7 srv.c, 1.14,
1.15 term.c, 1.11, 1.12
- Next message: [Asterisk-cvs]
asterisk/res res_agi.c, 1.40, 1.41 res_crypto.c, 1.22,
1.23 res_indications.c, 1.12, 1.13 res_monitor.c, 1.36,
1.37 res_odbc.c, 1.16, 1.17 res_osp.c, 1.16, 1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv4517/apps
Modified Files:
app_adsiprog.c app_alarmreceiver.c app_directory.c app_macro.c
app_math.c app_setcallerid.c app_setcidname.c app_setcidnum.c
app_setrdnis.c app_settransfercapability.c app_sms.c
app_talkdetect.c app_txtcidname.c app_zapras.c app_zapscan.c
Log Message:
more ast_copy_string conversions
Index: app_adsiprog.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_adsiprog.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- app_adsiprog.c 6 Jun 2005 22:39:31 -0000 1.12
+++ app_adsiprog.c 10 Jul 2005 23:12:25 -0000 1.13
@@ -402,7 +402,7 @@
ast_log(LOG_WARNING, "No more flag space at line %d of %s\n", lineno, script);
return NULL;
}
- strncpy(state->flags[state->numflags].vname, name, sizeof(state->flags[state->numflags].vname) - 1);
+ ast_copy_string(state->flags[state->numflags].vname, name, sizeof(state->flags[state->numflags].vname));
state->flags[state->numflags].id = state->numflags + 1;
state->numflags++;
return &state->flags[state->numflags-1];
@@ -505,7 +505,7 @@
ast_log(LOG_WARNING, "No more key space at line %d of %s\n", lineno, script);
return NULL;
}
- strncpy(state->keys[state->numkeys].vname, name, sizeof(state->keys[state->numkeys].vname) - 1);
+ ast_copy_string(state->keys[state->numkeys].vname, name, sizeof(state->keys[state->numkeys].vname));
state->keys[state->numkeys].id = state->numkeys + 2;
state->numkeys++;
return &state->keys[state->numkeys-1];
@@ -521,7 +521,7 @@
ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, script);
return NULL;
}
- strncpy(state->subs[state->numsubs].vname, name, sizeof(state->subs[state->numsubs].vname) - 1);
+ ast_copy_string(state->subs[state->numsubs].vname, name, sizeof(state->subs[state->numsubs].vname));
state->subs[state->numsubs].id = state->numsubs;
state->numsubs++;
return &state->subs[state->numsubs-1];
@@ -540,7 +540,7 @@
ast_log(LOG_WARNING, "No more state space at line %d of %s\n", lineno, script);
return NULL;
}
- strncpy(state->states[state->numstates].vname, name, sizeof(state->states[state->numstates].vname) - 1);
+ ast_copy_string(state->states[state->numstates].vname, name, sizeof(state->states[state->numstates].vname));
state->states[state->numstates].id = state->numstates + 1;
state->numstates++;
return &state->states[state->numstates-1];
@@ -559,7 +559,7 @@
ast_log(LOG_WARNING, "No more display space at line %d of %s\n", lineno, script);
return NULL;
}
- strncpy(state->displays[state->numdisplays].vname, name, sizeof(state->displays[state->numdisplays].vname) - 1);
+ ast_copy_string(state->displays[state->numdisplays].vname, name, sizeof(state->displays[state->numdisplays].vname));
state->displays[state->numdisplays].id = state->numdisplays + 1;
state->numdisplays++;
return &state->displays[state->numdisplays-1];
@@ -1045,7 +1045,7 @@
break;
}
} else {
- strncpy(tmp2, tmp, sizeof(tmp2) - 1);
+ ast_copy_string(tmp2, tmp, sizeof(tmp2));
}
if (strlen(tmp2) > 18) {
ast_log(LOG_WARNING, "Truncating full name to 18 characters at line %d of %s\n", lineno, script);
@@ -1338,7 +1338,7 @@
int x, err;
struct adsi_script *scr;
if (script[0] == '/')
- strncpy(fn, script, sizeof(fn) - 1);
+ ast_copy_string(fn, script, sizeof(fn));
else
snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, script);
f = fopen(fn, "r");
Index: app_alarmreceiver.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_alarmreceiver.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- app_alarmreceiver.c 9 Jun 2005 14:39:34 -0000 1.11
+++ app_alarmreceiver.c 10 Jul 2005 23:12:25 -0000 1.12
@@ -310,7 +310,7 @@
/* Extract the caller ID location */
if (chan->cid.cid_num)
- strncpy(workstring, chan->cid.cid_num, sizeof(workstring) - 1);
+ ast_copy_string(workstring, chan->cid.cid_num, sizeof(workstring));
workstring[sizeof(workstring) - 1] = '\0';
ast_callerid_parse(workstring, &cn, &cl);
@@ -389,7 +389,7 @@
/* Make a template */
- strncpy(workstring, event_spool_dir, sizeof(workstring) - 1);
+ ast_copy_string(workstring, event_spool_dir, sizeof(workstring));
strncat(workstring, event_file, sizeof(workstring) - strlen(workstring) - 1);
/* Make the temporary file */
@@ -581,7 +581,7 @@
memset(enew, 0, sizeof(event_node_t));
enew->next = NULL;
- strncpy(enew->data, event, sizeof(enew->data) - 1);
+ ast_copy_string(enew->data, event, sizeof(enew->data));
/*
* Insert event onto end of list
@@ -654,7 +654,7 @@
/* Set default values for this invokation of the application */
- strncpy(signalling_type, ADEMCO_CONTACT_ID, sizeof(signalling_type) - 1);
+ ast_copy_string(signalling_type, ADEMCO_CONTACT_ID, sizeof(signalling_type));
/* Answer the channel if it is not already */
@@ -751,7 +751,7 @@
p = ast_variable_retrieve(cfg, "general", "eventcmd");
if(p){
- strncpy(event_app, p, sizeof(event_app) - 1);
+ ast_copy_string(event_app, p, sizeof(event_app));
event_app[sizeof(event_app) - 1] = '\0';
}
@@ -791,21 +791,21 @@
p = ast_variable_retrieve(cfg, "general", "eventspooldir");
if(p){
- strncpy(event_spool_dir, p, sizeof(event_spool_dir) - 1);
+ ast_copy_string(event_spool_dir, p, sizeof(event_spool_dir));
event_spool_dir[sizeof(event_spool_dir) - 1] = '\0';
}
p = ast_variable_retrieve(cfg, "general", "timestampformat");
if(p){
- strncpy(time_stamp_format, p, sizeof(time_stamp_format) - 1);
+ ast_copy_string(time_stamp_format, p, sizeof(time_stamp_format));
time_stamp_format[sizeof(time_stamp_format) - 1] = '\0';
}
p = ast_variable_retrieve(cfg, "general", "db-family");
if(p){
- strncpy(db_family, p, sizeof(db_family) - 1);
+ ast_copy_string(db_family, p, sizeof(db_family));
db_family[sizeof(db_family) - 1] = '\0';
}
ast_config_destroy(cfg);
Index: app_directory.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- app_directory.c 6 Jun 2005 22:39:31 -0000 1.38
+++ app_directory.c 10 Jul 2005 23:12:25 -0000 1.39
@@ -183,9 +183,9 @@
/* Name selected */
loop = 0;
if (ast_exists_extension(chan,dialcontext,ext,1,chan->cid.cid_num)) {
- strncpy(chan->exten, ext, sizeof(chan->exten)-1);
+ ast_copy_string(chan->exten, ext, sizeof(chan->exten));
chan->priority = 0;
- strncpy(chan->context, dialcontext, sizeof(chan->context)-1);
+ ast_copy_string(chan->context, dialcontext, sizeof(chan->context));
} else {
ast_log(LOG_WARNING,
"Can't find extension '%s' in context '%s'. "
@@ -296,7 +296,7 @@
if (ast_exists_extension(chan,chan->context,"o",1,chan->cid.cid_num) ||
(!ast_strlen_zero(chan->macrocontext) &&
ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num))) {
- strncpy(chan->exten, "o", sizeof(chan->exten)-1);
+ strcpy(chan->exten, "o");
chan->priority = 0;
return 0;
} else {
@@ -310,7 +310,7 @@
if (ast_exists_extension(chan,chan->context,"a",1,chan->cid.cid_num) ||
(!ast_strlen_zero(chan->macrocontext) &&
ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->cid.cid_num))) {
- strncpy(chan->exten, "a", sizeof(chan->exten)-1);
+ strcpy(chan->exten, "a");
chan->priority = 0;
return 0;
} else {
@@ -337,7 +337,7 @@
strsep(&stringp, ",");
pos = strsep(&stringp, ",");
if (pos) {
- strncpy(name, pos, sizeof(name) - 1);
+ ast_copy_string(name, pos, sizeof(name));
/* Grab the last name */
if (last && strrchr(pos,' '))
pos = strrchr(pos, ' ') + 1;
@@ -371,8 +371,8 @@
case '1':
/* user pressed '1' and extensions exists */
lastuserchoice = res;
- strncpy(chan->context, dialcontext, sizeof(chan->context) - 1);
- strncpy(chan->exten, v->name, sizeof(chan->exten) - 1);
+ ast_copy_string(chan->context, dialcontext, sizeof(chan->context));
+ ast_copy_string(chan->exten, v->name, sizeof(chan->exten));
chan->priority = 0;
break;
case '*':
Index: app_macro.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_macro.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- app_macro.c 6 Jun 2005 22:39:31 -0000 1.24
+++ app_macro.c 10 Jul 2005 23:12:25 -0000 1.25
@@ -124,11 +124,11 @@
LOCAL_USER_ADD(u);
/* Save old info */
oldpriority = chan->priority;
- strncpy(oldexten, chan->exten, sizeof(oldexten) - 1);
- strncpy(oldcontext, chan->context, sizeof(oldcontext) - 1);
+ ast_copy_string(oldexten, chan->exten, sizeof(oldexten));
+ ast_copy_string(oldcontext, chan->context, sizeof(oldcontext));
if (ast_strlen_zero(chan->macrocontext)) {
- strncpy(chan->macrocontext, chan->context, sizeof(chan->macrocontext) - 1);
- strncpy(chan->macroexten, chan->exten, sizeof(chan->macroexten) - 1);
+ ast_copy_string(chan->macrocontext, chan->context, sizeof(chan->macrocontext));
+ ast_copy_string(chan->macroexten, chan->exten, sizeof(chan->macroexten));
chan->macropriority = chan->priority;
setmacrocontext=1;
}
@@ -158,7 +158,7 @@
/* Setup environment for new run */
chan->exten[0] = 's';
chan->exten[1] = '\0';
- strncpy(chan->context, fullmacro, sizeof(chan->context) - 1);
+ ast_copy_string(chan->context, fullmacro, sizeof(chan->context));
chan->priority = 1;
while((cur = strsep(&rest, "|")) && (argc < MAX_ARGS)) {
@@ -246,10 +246,10 @@
if (!strcasecmp(chan->context, fullmacro)) {
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
- strncpy(chan->context, oldcontext, sizeof(chan->context) - 1);
+ ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
if (!(chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO)) {
/* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */
- strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1);
+ ast_copy_string(chan->exten, oldexten, sizeof(chan->exten));
if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
/* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
normally if there is any problem */
Index: app_math.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_math.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- app_math.c 12 Jun 2005 16:43:37 -0000 1.11
+++ app_math.c 10 Jul 2005 23:12:25 -0000 1.12
@@ -1,7 +1,7 @@
/*
* Asterisk -- A telephony toolkit for Linux.
*
- * simple maths application
+ * simple math application
*
* Copyright (C) 2004 - 2005, Andy Powell
*
@@ -199,33 +199,33 @@
}
case GTFUNCTION :
if (fnum1 > fnum2)
- strncpy (user_result, "TRUE", sizeof (user_result) - 1);
+ strcpy(user_result, "TRUE");
else
- strncpy (user_result, "FALSE", sizeof (user_result) - 1);
+ strcpy(user_result, "FALSE");
break;
case LTFUNCTION :
if (fnum1 < fnum2)
- strncpy (user_result, "TRUE", sizeof (user_result) - 1);
+ strcpy(user_result, "TRUE");
else
- strncpy (user_result, "FALSE", sizeof (user_result) - 1);
+ strcpy(user_result, "FALSE");
break;
case GTEFUNCTION :
if (fnum1 >= fnum2)
- strncpy (user_result, "TRUE", sizeof (user_result) - 1);
+ strcpy(user_result, "TRUE");
else
- strncpy (user_result, "FALSE", sizeof (user_result) - 1);
+ strcpy(user_result, "FALSE");
break;
case LTEFUNCTION :
if (fnum1 <= fnum2)
- strncpy (user_result, "TRUE", sizeof (user_result) - 1);
+ strcpy(user_result, "TRUE");
else
- strncpy (user_result, "FALSE", sizeof (user_result) - 1);
+ strcpy(user_result, "FALSE");
break;
case EQFUNCTION :
if (fnum1 == fnum2)
- strncpy (user_result, "TRUE", sizeof (user_result) - 1);
+ strcpy(user_result, "TRUE");
else
- strncpy (user_result, "FALSE", sizeof (user_result) - 1);
+ strcpy(user_result, "FALSE");
break;
default :
ast_log(LOG_WARNING, "Something happened that neither of us should be proud of %d\n", iaction);
Index: app_setcallerid.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_setcallerid.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- app_setcallerid.c 6 Jun 2005 22:39:31 -0000 1.8
+++ app_setcallerid.c 10 Jul 2005 23:12:25 -0000 1.9
@@ -93,7 +93,7 @@
char *opt;
int anitoo = 0;
if (data)
- strncpy(tmp, (char *)data, sizeof(tmp) - 1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
opt = strchr(tmp, '|');
if (opt) {
*opt = '\0';
Index: app_setcidname.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_setcidname.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- app_setcidname.c 6 Jun 2005 22:39:32 -0000 1.9
+++ app_setcidname.c 10 Jul 2005 23:12:25 -0000 1.10
@@ -61,7 +61,7 @@
}
if (data)
- strncpy(tmp, (char *)data, sizeof(tmp) - 1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
opt = strchr(tmp, '|');
if (opt) {
*opt = '\0';
Index: app_setcidnum.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_setcidnum.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- app_setcidnum.c 6 Jun 2005 22:39:32 -0000 1.10
+++ app_setcidnum.c 10 Jul 2005 23:12:25 -0000 1.11
@@ -63,7 +63,7 @@
}
if (data)
- strncpy(tmp, (char *)data, sizeof(tmp) - 1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
opt = strchr(tmp, '|');
if (opt) {
*opt = '\0';
Index: app_setrdnis.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_setrdnis.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_setrdnis.c 6 Jun 2005 22:39:32 -0000 1.5
+++ app_setrdnis.c 10 Jul 2005 23:12:25 -0000 1.6
@@ -59,7 +59,7 @@
}
if (data)
- strncpy(tmp, (char *)data, sizeof(tmp) - 1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
else
tmp[0] = '\0';
opt = strchr(tmp, '|');
Index: app_settransfercapability.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_settransfercapability.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_settransfercapability.c 6 Jun 2005 22:39:32 -0000 1.5
+++ app_settransfercapability.c 10 Jul 2005 23:12:25 -0000 1.6
@@ -66,7 +66,7 @@
int transfercapability = -1;
if (data)
- strncpy(tmp, (char *)data, sizeof(tmp) - 1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
opts = strchr(tmp, '|');
if (opts)
*opts = '\0';
Index: app_sms.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_sms.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- app_sms.c 8 Jul 2005 17:06:53 -0000 1.23
+++ app_sms.c 10 Jul 2005 23:12:25 -0000 1.24
@@ -848,11 +848,11 @@
{
char fn[200] = "", fn2[200] = "";
FILE *o;
- strncpy (fn, spool_dir, sizeof (fn) - 1);
+ ast_copy_string (fn, spool_dir, sizeof (fn));
mkdir (fn, 0777); /* ensure it exists */
snprintf (fn + strlen (fn), sizeof (fn) - strlen (fn), "/%s", h->smsc ? h->rx ? "morx" : "mttx" : h->rx ? "mtrx" : "motx");
mkdir (fn, 0777); /* ensure it exists */
- strncpy (fn2, fn, sizeof (fn2) - 1);
+ ast_copy_string (fn2, fn, sizeof (fn2));
snprintf (fn2 + strlen (fn2), sizeof (fn2) - strlen (fn2), "/%s.%s-%d", h->queue, isodate (h->scts), seq++);
snprintf (fn + strlen (fn), sizeof (fn) - strlen (fn), "/.%s", fn2 + strlen (fn) + 1);
o = fopen (fn, "w");
@@ -951,7 +951,7 @@
h->srr = ((h->imsg[2] & 0x20) ? 1 : 0);
h->udhi = ((h->imsg[2] & 0x40) ? 1 : 0);
h->rp = ((h->imsg[2] & 0x80) ? 1 : 0);
- strncpy (h->oa, h->cli, sizeof (h->oa) - 1);
+ ast_copy_string (h->oa, h->cli, sizeof (h->oa));
h->scts = time (0);
h->mr = h->imsg[p++];
p += unpackaddress (h->da, h->imsg + p);
@@ -1018,7 +1018,7 @@
char fn[100 + NAME_MAX] = "";
DIR *d;
char more = 0;
- strncpy (fn, spool_dir, sizeof (fn) - 1);
+ ast_copy_string (fn, spool_dir, sizeof (fn));
mkdir (fn, 0777); /* ensure it exists */
h->rx = 0; /* outgoing message */
snprintf (fn + strlen (fn), sizeof (fn) - strlen (fn), "/%s", h->smsc ? "mttx" : "motx");
@@ -1360,7 +1360,7 @@
}
if (chan->cid.cid_num)
- strncpy (h.cli, chan->cid.cid_num, sizeof (h.cli) - 1);
+ ast_copy_string (h.cli, chan->cid.cid_num, sizeof (h.cli));
{
unsigned char *d = data,
@@ -1422,12 +1422,12 @@
return 0;
}
if (h.smsc) {
- strncpy (h.oa, d, sizeof (h.oa) - 1);
+ ast_copy_string (h.oa, d, sizeof (h.oa));
} else {
- strncpy (h.da, d, sizeof (h.da) - 1);
+ ast_copy_string (h.da, d, sizeof (h.da));
}
if (!h.smsc)
- strncpy (h.oa, h.cli, sizeof (h.oa) - 1);
+ ast_copy_string (h.oa, h.cli, sizeof (h.oa));
d = p;
h.udl = 0;
while (*p && h.udl < SMSLEN)
Index: app_talkdetect.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_talkdetect.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- app_talkdetect.c 6 Jun 2005 22:39:32 -0000 1.9
+++ app_talkdetect.c 10 Jul 2005 23:12:25 -0000 1.10
@@ -70,7 +70,7 @@
ast_log(LOG_WARNING, "BackgroundDetect requires an argument (filename)\n");
return -1;
}
- strncpy(tmp, (char *)data, sizeof(tmp)-1);
+ ast_copy_string(tmp, (char *)data, sizeof(tmp));
stringp=tmp;
strsep(&stringp, "|");
options = strsep(&stringp, "|");
@@ -158,7 +158,7 @@
pbx_builtin_setvar_helper(chan, "TALK_DETECTED", ms_str);
if (ast_exists_extension(chan, chan->context, "talk", 1, chan->cid.cid_num)) {
- strncpy(chan->exten, "talk", sizeof(chan->exten) -1 );
+ ast_copy_string(chan->exten, "talk", sizeof(chan->exten));
chan->priority = 0;
}
res = 0;
Index: app_txtcidname.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_txtcidname.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- app_txtcidname.c 23 Jun 2005 22:00:10 -0000 1.13
+++ app_txtcidname.c 10 Jul 2005 23:12:25 -0000 1.14
@@ -95,9 +95,9 @@
cfg = ast_config_load(ENUM_CONFIG);
if (cfg) {
if (!(s=ast_variable_retrieve(cfg, "general", "h323driver"))) {
- strncpy(h323driver, H323DRIVERDEFAULT, sizeof(h323driver) - 1);
+ ast_copy_string(h323driver, H323DRIVERDEFAULT, sizeof(h323driver));
} else {
- strncpy(h323driver, s, sizeof(h323driver) - 1);
+ ast_copy_string(h323driver, s, sizeof(h323driver));
}
ast_config_destroy(cfg);
return 0;
Index: app_zapras.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_zapras.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- app_zapras.c 6 Jul 2005 01:41:54 -0000 1.11
+++ app_zapras.c 10 Jul 2005 23:12:25 -0000 1.12
@@ -193,7 +193,7 @@
if (!data)
data = "";
LOCAL_USER_ADD(u);
- strncpy(args, data, sizeof(args) - 1);
+ ast_copy_string(args, data, sizeof(args));
/* Answer the channel if it's not up */
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
Index: app_zapscan.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_zapscan.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- app_zapscan.c 7 Jun 2005 16:59:20 -0000 1.19
+++ app_zapscan.c 10 Jul 2005 23:12:25 -0000 1.20
@@ -332,7 +332,7 @@
}
if ( tempchan && tempchan->type && (!strcmp(tempchan->type, "Zap")) && (tempchan != chan) ) {
ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
- strncpy(confstr, tempchan->name, sizeof(confstr) - 1);
+ ast_copy_string(confstr, tempchan->name, sizeof(confstr));
ast_mutex_unlock(&tempchan->lock);
if ((tmp = strchr(confstr,'-'))) {
*tmp = '\0';
- Previous message: [Asterisk-cvs] asterisk acl.c, 1.47, 1.48 astmm.c, 1.16,
1.17 callerid.c, 1.33, 1.34 cli.c, 1.89, 1.90 config.c, 1.72,
1.73 enum.c, 1.27, 1.28 frame.c, 1.58, 1.59 logger.c, 1.76,
1.77 manager.c, 1.101, 1.102 privacy.c, 1.6, 1.7 srv.c, 1.14,
1.15 term.c, 1.11, 1.12
- Next message: [Asterisk-cvs]
asterisk/res res_agi.c, 1.40, 1.41 res_crypto.c, 1.22,
1.23 res_indications.c, 1.12, 1.13 res_monitor.c, 1.36,
1.37 res_odbc.c, 1.16, 1.17 res_osp.c, 1.16, 1.17
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list