[Asterisk-cvs] asterisk/cdr cdr_custom.c,1.5,1.6

markster at lists.digium.com markster at lists.digium.com
Thu Mar 31 21:45:09 CST 2005


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

Modified Files:
	cdr_custom.c 
Log Message:
Add CDR custom config warnings (Borga borga!) :)


Index: cdr_custom.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr/cdr_custom.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cdr_custom.c	31 Mar 2005 15:55:44 -0000	1.5
+++ cdr_custom.c	1 Apr 2005 03:38:35 -0000	1.6
@@ -61,6 +61,8 @@
 		while(var) {
 			ast_mutex_lock(&lock);
 			if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {
+				if (strlen(var->value) > (sizeof(format) - 2))
+					ast_log(LOG_WARNING, "Format string too long, will be truncated, at line %d\n", var->lineno);
 				strncpy(format, var->value, sizeof(format) - 2);
 				strcat(format,"\n");
 				snprintf(master, sizeof(master),"%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
@@ -72,6 +74,11 @@
 			var = var->next;
 		}
 		ast_config_destroy(cfg);
+	} else {
+		if (reload)
+			ast_log(LOG_WARNING, "Failed to reload configuration file.\n");
+		else
+			ast_log(LOG_WARNING, "Failed to load configuration file. Module not activated.\n");
 	}
 	
 	return res;




More information about the svn-commits mailing list