Don't waste time initializing the whole call_identifer_str[].
authorRichard Mudgett <rmudgett@digium.com>
Wed, 20 Jun 2012 21:33:11 +0000 (21:33 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 20 Jun 2012 21:33:11 +0000 (21:33 +0000)
The array is either setup with a callid string or only the first element
needs to be initialized.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369167 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/logger.c

index 93be752..6bfafe9 100644 (file)
@@ -1027,11 +1027,12 @@ static void logger_print_normal(struct logmsg *logmsg)
 
        if (!AST_RWLIST_EMPTY(&logchannels)) {
                AST_RWLIST_TRAVERSE(&logchannels, chan, list) {
-                       /* XXX May need to grow larger later in order to accomodate call counts higher than 999999. */
-                       char call_identifier_str[13] = "";
+                       char call_identifier_str[13];
 
                        if (logmsg->callid) {
                                snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", logmsg->callid->call_identifier);
+                       } else {
+                               call_identifier_str[0] = '\0';
                        }