[asterisk-commits] trunk r10786 - /trunk/logger.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 22 14:53:57 MST 2006


Author: kpfleming
Date: Wed Feb 22 15:53:56 2006
New Revision: 10786

URL: http://svn.digium.com/view/asterisk?rev=10786&view=rev
Log:
use a symbolic constant instead of a magic number (tholo!)

Modified:
    trunk/logger.c

Modified: trunk/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/logger.c?rev=10786&r1=10785&r2=10786&view=diff
==============================================================================
--- trunk/logger.c (original)
+++ trunk/logger.c Wed Feb 22 15:53:56 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -36,6 +36,7 @@
 #include <sys/stat.h>
 #ifdef STACK_BACKTRACES
 #include <execinfo.h>
+#define MAX_BACKTRACE_FRAMES 20
 #endif
 
 #define SYSLOG_NAMES /* so we can map syslog facilities names to their numeric values,
@@ -836,9 +837,9 @@
 	void **addresses;
 	char **strings;
 
-	addresses = calloc(20, sizeof(void *));
+	addresses = calloc(MAX_BACKTRACE_FRAMES, sizeof(void *));
 	if (addresses) {
-		count = backtrace(addresses, 20);
+		count = backtrace(addresses, MAX_BACKTRACE_FRAMES);
 		strings = backtrace_symbols(addresses, count);
 		if (strings) {
 			ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", count, count != 1 ? 's' : ' ');



More information about the asterisk-commits mailing list