[Asterisk-cvs] asterisk/apps app_disa.c,1.40,1.41

russell russell
Wed Oct 26 22:56:08 CDT 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv20591/apps

Modified Files:
	app_disa.c 
Log Message:
strncpy to ast_copy_string


Index: app_disa.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_disa.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- app_disa.c	26 Oct 2005 19:48:14 -0000	1.40
+++ app_disa.c	27 Oct 2005 02:48:56 -0000	1.41
@@ -164,7 +164,7 @@
 	ourcontext = strsep(&stringp, "|");
 	/* if context specified, save 2nd arg and parse third */
 	if (ourcontext) {
-		strncpy(arg2,ourcontext, sizeof(arg2) - 1);
+		ast_copy_string(arg2, ourcontext, sizeof(arg2));
 		ourcallerid = strsep(&stringp,"|");
 	}
 	  /* if context not specified, use "disa" */
@@ -306,7 +306,7 @@
 					k|=1; /* In number mode */
 					i = 0;  /* re-set buffer pointer */
 					exten[sizeof(acctcode)] = 0;
-					strncpy(acctcode,exten, sizeof(acctcode) - 1);
+					ast_copy_string(acctcode, exten, sizeof(acctcode));
 					exten[0] = 0;
 					ast_log(LOG_DEBUG,"Successful DISA log-in on chan %s\n",chan->name);
 					continue;
@@ -353,7 +353,7 @@
 			}
 
 			if (!ast_strlen_zero(acctcode))
-				strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
+				ast_copy_string(chan->accountcode, acctcode, sizeof(chan->accountcode));
 
 			ast_cdr_reset(chan->cdr, AST_CDR_FLAG_POSTED);
 			ast_explicit_goto(chan, ourcontext, exten, 1);




More information about the svn-commits mailing list