Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.47
diff -u -r1.47 pbx.c
--- pbx.c	8 Sep 2003 21:52:45 -0000	1.47
+++ pbx.c	10 Sep 2003 01:31:18 -0000
@@ -1134,7 +1134,7 @@
 			ast_mutex_unlock(&conlock);
 			if (app) {
 				if (c->context != context)
-					strncpy(c->context, context, sizeof(c->context-1));
+					strncpy(c->context, context, sizeof(c->context)-1);
 				if (c->exten != exten)
 					strncpy(c->exten, exten, sizeof(c->exten)-1);
 				c->priority = priority;
@@ -2512,7 +2512,7 @@
 
 	/* try to lock contexts */
 	if (ast_lock_contexts()) {
-		ast_cli(LOG_WARNING, "Failed to lock contexts list\n");
+		ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 		return RESULT_FAILURE;
 	}
 
@@ -3798,12 +3798,16 @@
 				res = 0;
 				if (option_verbose > 3)
 					ast_verbose(VERBOSE_PREFIX_4 "Channel %s was answered.\n", chan->name);
-				if (context && strlen(context))
+				if (context && *context)
 					strncpy(chan->context, context, sizeof(chan->context) - 1);
-				if (exten && strlen(exten))
+				if (exten && *exten)
 					strncpy(chan->exten, exten, sizeof(chan->exten) - 1);
-				if (callerid && strlen(callerid))
-					strncpy(chan->callerid, callerid, sizeof(chan->callerid) - 1);
+				if (callerid && *callerid) {
+					/* XXX call ast_set_callerid? */
+					if (chan->callerid)
+						free(chan->callerid);
+					chan->callerid = strdup(callerid);
+				}
 				if (priority > 0)
 					chan->priority = priority;
 				if (sync > 1) {
Index: apps/app_queue.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v
retrieving revision 1.34
diff -u -r1.34 app_queue.c
--- apps/app_queue.c	8 Sep 2003 16:48:06 -0000	1.34
+++ apps/app_queue.c	10 Sep 2003 01:31:19 -0000
@@ -1383,7 +1383,7 @@
 			pos = 1;
 			ast_cli(fd, "   Callers: \n");
 			for (qe = q->head; qe; qe = qe->next) 
-				ast_cli(fd, "      %d. %s (wait: %d:%02.2d)\n", pos++, qe->chan->name,
+				ast_cli(fd, "      %d. %s (wait: %d:%2.2d)\n", pos++, qe->chan->name,
 								(now - qe->start) / 60, (now - qe->start) % 60);
 		} else
 			ast_cli(fd, "   No Callers\n");
@@ -1441,7 +1441,7 @@
 				"Wait: %ld\r\n"
 				"%s"
 				"\r\n", 
-					q->name, pos++, qe->chan->name, (qe->chan->callerid ? qe->chan->callerid : ""), now - qe->start), idText;
+					q->name, pos++, qe->chan->name, (qe->chan->callerid ? qe->chan->callerid : ""), (long)(now - qe->start), idText);
 		ast_mutex_unlock(&q->lock);
 		q = q->next;
 	}
Index: include/asterisk/cli.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/cli.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 cli.h
--- include/asterisk/cli.h	12 Feb 2003 13:59:15 -0000	1.1.1.1
+++ include/asterisk/cli.h	10 Sep 2003 01:31:20 -0000
@@ -20,7 +20,8 @@
 
 #include <stdarg.h>
 
-extern void ast_cli(int fd, char *fmt, ...);
+extern void ast_cli(int fd, char *fmt, ...)
+	__attribute__ ((format (printf, 2, 3)));
 
 #define RESULT_SUCCESS		0
 #define RESULT_SHOWUSAGE	1
Index: pbx/pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.14
diff -u -r1.14 pbx_config.c
--- pbx/pbx_config.c	13 Aug 2003 15:25:16 -0000	1.14
+++ pbx/pbx_config.c	10 Sep 2003 01:31:21 -0000
@@ -1334,7 +1334,7 @@
 				break;
 
 			default:
-				ast_cli(fd, "Failed to remove ignore pattern '%s' from '%s' context\n");
+				ast_cli(fd, "Failed to remove ignore pattern '%s' from '%s' context\n", argv[2], argv[4]);
 				break;
 		}
 		return RESULT_FAILURE;
Index: res/res_monitor.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v
retrieving revision 1.4
diff -u -r1.4 res_monitor.c
--- res/res_monitor.c	8 Sep 2003 16:44:36 -0000	1.4
+++ res/res_monitor.c	10 Sep 2003 01:31:21 -0000
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 
 #include <asterisk/lock.h>
 #include <asterisk/channel.h>
Index: res/res_parking.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_parking.c,v
retrieving revision 1.8
diff -u -r1.8 res_parking.c
--- res/res_parking.c	13 Aug 2003 15:25:16 -0000	1.8
+++ res/res_parking.c	10 Sep 2003 01:31:22 -0000
@@ -582,7 +582,7 @@
 
 	cur=parkinglot;
 	while(cur) {
-		ast_cli(fd, "%4d %25s (%-15s %-12s %-4d) %6ds\n"
+		ast_cli(fd, "%4d %25s (%-15s %-12s %-4d) %6lds\n"
 			,cur->parkingnum, cur->chan->name, cur->context, cur->exten
 			,cur->priority, cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL));
 
