[asterisk-commits] mogorman: trunk r49464 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 4 11:28:51 MST 2007


Author: mogorman
Date: Thu Jan  4 12:28:50 2007
New Revision: 49464

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49464
Log:
Merged revisions 49459 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.4

................
r49459 | mogorman | 2007-01-04 12:11:19 -0600 (Thu, 04 Jan 2007) | 10 lines

Merged revisions 49447 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.2

........
r49447 | mogorman | 2007-01-04 11:45:16 -0600 (Thu, 04 Jan 2007) | 2 lines

converted a lot of 256 to PATH_MAX and some white space fixes.

........

................

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=49464&r1=49463&r2=49464
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Jan  4 12:28:50 2007
@@ -331,10 +331,10 @@
 struct vm_state {
 	char curbox[80];
 	char username[80];
-	char curdir[256];
-	char vmbox[256];
-	char fn[256];
-	char fn2[256];
+	char curdir[PATH_MAX];
+	char vmbox[PATH_MAX];
+	char fn[PATH_MAX];
+	char fn2[PATH_MAX];
 	int *deleted;
 	int *heard;
 	int curmsg;
@@ -784,7 +784,7 @@
 	int linenum=0;
 	char inbuf[256];
 	char orig[256];
-	char currcontext[256] ="";
+	char currcontext[256] = "";
 	char tmpin[PATH_MAX];
 	char tmpout[PATH_MAX];
 	struct stat statbuf;
@@ -1015,7 +1015,7 @@
 	void *fdm=NULL;
 	SQLSMALLINT colcount=0;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char fmt[80]="";
 	char *c;
 	char coltitle[256];
@@ -1027,8 +1027,8 @@
 	SQLLEN colsize2;
 	FILE *f=NULL;
 	char rowdata[80];
-	char fn[256];
-	char full_fn[256];
+	char fn[PATH_MAX];
+	char full_fn[PATH_MAX];
 	char msgnums[80];
 	
 	struct odbc_obj *obj;
@@ -1175,8 +1175,8 @@
 
 static int remove_file(char *dir, int msgnum)
 {
-	char fn[256];
-	char full_fn[256];
+	char fn[PATH_MAX];
+	char full_fn[PATH_MAX];
 	char msgnums[80];
 	
 	if (msgnum > -1) {
@@ -1195,7 +1195,7 @@
 	int x = 0;
 	int res;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char rowdata[20];
 	
 	struct odbc_obj *obj;
@@ -1252,7 +1252,7 @@
 	int x = 0;
 	int res;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char rowdata[20];
 	char msgnums[20];
 	
@@ -1316,7 +1316,7 @@
 {
 	int res;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char msgnums[20];
 	
 	struct odbc_obj *obj;
@@ -1412,10 +1412,10 @@
 	size_t fdlen = -1;
 	SQLHSTMT stmt;
 	SQLINTEGER len;
-	char sql[256];
+	char sql[PATH_MAX];
 	char msgnums[20];
-	char fn[256];
-	char full_fn[256];
+	char fn[PATH_MAX];
+	char full_fn[PATH_MAX];
 	char fmt[80]="";
 	char *c;
 	const char *context="", *macrocontext="", *callerid="", *origtime="", *duration="";
@@ -1524,7 +1524,7 @@
 {
 	int res;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char msgnums[20];
 	char msgnumd[20];
 	struct odbc_obj *obj;
@@ -1596,8 +1596,8 @@
 
 static void rename_file(char *sfn, char *dfn)
 {
-	char stxt[256];
-	char dtxt[256];
+	char stxt[PATH_MAX];
+	char dtxt[PATH_MAX];
 	ast_filerename(sfn,dfn,NULL);
 	snprintf(stxt, sizeof(stxt), "%s.txt", sfn);
 	snprintf(dtxt, sizeof(dtxt), "%s.txt", dfn);
@@ -1656,7 +1656,7 @@
 
 static void copy_file(char *frompath, char *topath)
 {
-	char frompath2[256],topath2[256];
+	char frompath2[PATH_MAX], topath2[PATH_MAX];
 	ast_filecopy(frompath, topath, NULL);
 	snprintf(frompath2, sizeof(frompath2), "%s.txt", frompath);
 	snprintf(topath2, sizeof(topath2), "%s.txt", topath);
@@ -2075,11 +2075,11 @@
 static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category)
 {
 	char date[256];
-	char host[MAXHOSTNAMELEN]="";
+	char host[MAXHOSTNAMELEN] = "";
 	char who[256];
-	char dur[256];
+	char dur[PATH_MAX];
 	char tmp[80] = "/tmp/astmail-XXXXXX";
-	char tmp2[256];
+	char tmp2[PATH_MAX];
 	struct tm tm;
 	FILE *p;
 
@@ -2168,12 +2168,12 @@
 static int invent_message(struct ast_channel *chan, char *context, char *ext, int busy, char *ecodes)
 {
 	int res;
-	char fn[256];
-	char dest[256];
+	char fn[PATH_MAX];
+	char dest[PATH_MAX];
 
 	snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
 
-	if (!(res = create_dirpath(dest,256,context,ext,"greet"))) {
+	if (!(res = create_dirpath(dest, sizeof(dest), context, ext, "greet"))) {
 		ast_log(LOG_WARNING, "Failed to make directory(%s)\n", fn);
 		return -1;
 	}
@@ -2233,9 +2233,9 @@
 	int x = -1;
 	int res;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char rowdata[20];
-	char tmp[256]="";
+	char tmp[PATH_MAX] = "";
 	struct odbc_obj *obj;
 	char *context;
 
@@ -2349,7 +2349,7 @@
 	int nummsgs = 0;
 	int res;
 	SQLHSTMT stmt = NULL;
-	char sql[256];
+	char sql[PATH_MAX];
 	char rowdata[20];
 	if (!folder)
 		folder = "INBOX";
@@ -2420,7 +2420,7 @@
 static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms)
 {
 	char *myserveremail = serveremail;
-	char fn[256];
+	char fn[PATH_MAX];
 	char mailbox[256];
 	char *stringp;
 	FILE *p=NULL;
@@ -2483,7 +2483,7 @@
  
  	struct ast_vm_user *vmu;
  	struct vm_state *vms_p;
- 	char tmp[256]="";
+ 	char tmp[256] = "";
  	char *mb, *cur;
  	char *mailboxnc; 
  	char *context;
@@ -2641,7 +2641,7 @@
 static int messagecount(const char *context, const char *mailbox, const char *folder)
 {
 	int newmsgs, oldmsgs;
- 	char tmp[256]="";
+ 	char tmp[256] = "";
 	
  	if (ast_strlen_zero(mailbox))
  		return 0;
@@ -2658,8 +2658,7 @@
 /* copy message only used by file storage */
 static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt)
 {
-	
-	char fromdir[256], todir[256], frompath[256], topath[256];
+	char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
 	const char *frombox = mbox(imbox);
 	int recipmsgnum;
 
@@ -2842,7 +2841,7 @@
 	int newmsgs, oldmsgs;
 	struct vm_state *vms = NULL;
 #endif
-	char tmptxtfile[256], txtfile[256];
+	char txtfile[PATH_MAX], tmptxtfile[PATH_MAX];
 	char callerid[256];
 	FILE *txt;
 	char date[256];
@@ -2853,11 +2852,11 @@
 	int ausemacro = 0;
 	int ousemacro = 0;
 	int ouseexten = 0;
-	char dir[256], tmpdir[260];
-	char dest[256];
-	char fn[256];
-	char prefile[256]="";
-	char tempfile[256]="";
+	char dir[PATH_MAX], tmpdir[PATH_MAX];
+	char dest[PATH_MAX];
+	char fn[PATH_MAX];
+	char prefile[PATH_MAX] = "";
+	char tempfile[PATH_MAX] = "";
 	char ext_context[256] = "";
 	char fmt[80];
 	char *context;
@@ -3207,8 +3206,8 @@
 	/* we know max messages, so stop process when number is hit */
 
 	int x,dest;
-	char sfn[256];
-	char dfn[256];
+	char sfn[PATH_MAX];
+	char dfn[PATH_MAX];
 
 	if (vm_lock_path(dir))
 		return ERROR_LOCK_PATH;
@@ -3261,9 +3260,9 @@
 	char *dir = vms->curdir;
 	char *username = vms->username;
 	char *context = vmu->context;
-	char sfn[256];
-	char dfn[256];
-	char ddir[256];
+	char sfn[PATH_MAX];
+	char dfn[PATH_MAX];
+	char ddir[PATH_MAX];
 	const char *dbox = mbox(box);
 	int x;
 	make_file(sfn, sizeof(sfn), dir, msg);
@@ -3525,7 +3524,7 @@
 	int bytes=0;
 	unsigned char buf[256]; 
 	char buf1[256], buf2[256];
-	char fn2[256];
+	char fn2[PATH_MAX];
 
 	char cid[256]="";
 	char *val;
@@ -3785,7 +3784,7 @@
 {
 	int x;
 	int d;
-	char fn[256];
+	char fn[PATH_MAX];
 	d = ast_play_and_wait(chan, "vm-press");	/* "Press" */
 	if (d)
 		return d;
@@ -3908,7 +3907,7 @@
 
 static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
 {
-	char todir[256], fn[256], ext_context[256], *stringp;
+	char todir[PATH_MAX], fn[PATH_MAX], ext_context[PATH_MAX], *stringp;
 	int newmsgs = 0, oldmsgs = 0;
 	const char *category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY");
 
@@ -4299,7 +4298,7 @@
 	int res = 0;
 	int i;
 	char *callerid, *name;
-	char prefile[256]="";
+	char prefile[PATH_MAX] = "";
 	
 
 	/* If voicemail cid is not enabled, or we didn't get cid or context from the attribute file, leave now. */
@@ -4422,7 +4421,7 @@
 	char origtime[32];
 	char duration[16];
 	char category[32];
-	char todir[256];
+	char todir[PATH_MAX];
 	int res = 0;
 	char *temp;
 
@@ -5747,7 +5746,7 @@
 	int tries = 0;
 	char newpassword[80] = "";
 	char newpassword2[80] = "";
-	char prefile[256]="";
+	char prefile[PATH_MAX] = "";
 	unsigned char buf[256];
 	int bytes=0;
 
@@ -5827,7 +5826,7 @@
 	int duration = 0;
 	char newpassword[80] = "";
 	char newpassword2[80] = "";
-	char prefile[256]="";
+	char prefile[PATH_MAX] = "";
 	unsigned char buf[256];
 	int bytes=0;
 
@@ -5925,10 +5924,10 @@
 	int cmd = 0;
 	int retries = 0;
 	int duration = 0;
-	char prefile[256]="";
+	char prefile[PATH_MAX] = "";
 	unsigned char buf[256];
-	char dest[256];
-	int bytes=0;
+	char dest[PATH_MAX];
+	int bytes = 0;
 
 	if (ast_adsi_available(chan)) {
 		bytes += adsi_logo(buf + bytes);
@@ -7800,7 +7799,7 @@
 	char origtimeS[256],cidS[256],contextS[256];
 	char *header_content,*temp;
 #endif
-	char filename[256];
+	char filename[PATH_MAX];
 	struct ast_config *msg_cfg = NULL;
 	const char *origtime, *context;
 	char *cid, *name, *num;



More information about the asterisk-commits mailing list