Fix minor makefile issues (bug #3036)
[asterisk/asterisk.git] / utils / astman.c
index 1fa4156..ebeeb67 100755 (executable)
@@ -7,11 +7,11 @@
  
 #include <newt.h>
 #include <stdio.h>
-#include <sys/socket.h>
 #include <sys/time.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <sys/socket.h>
 #include <sys/select.h>
 #include <fcntl.h>
 #include <string.h>
@@ -178,8 +178,8 @@ static struct event {
 static int process_message(struct ast_mansession *s, struct message *m)
 {
        int x;
-       char event[80];
-       strncpy(event, get_header(m, "Event"), sizeof(event));
+       char event[80] = "";
+       strncpy(event, get_header(m, "Event"), sizeof(event) - 1);
        if (!strlen(event)) {
                fprintf(stderr, "Missing event in request");
                return 0;