unified socket application interface (for asterisk and maybe other apps)
[lcr.git] / trace.c
diff --git a/trace.c b/trace.c
index 9453bd7..f7ff74b 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -208,7 +208,7 @@ static char *print_trace(int detail, int port, char *interface, char *caller, ch
                SCAT(trace_string, "--");
        }
        if (trace.serial)
-               SPRINT(buffer, "(%d): %s", trace.serial, trace.name[0]?trace.name:"<unknown>");
+               SPRINT(buffer, "(%lu): %s", trace.serial, trace.name[0]?trace.name:"<unknown>");
        else
                SPRINT(buffer, ": %s", trace.name[0]?trace.name:"<unknown>");
        SCAT(trace_string, buffer);
@@ -307,7 +307,7 @@ void end_trace(void)
        }
 
        /* process admin */
-       admin = admin_list;
+       admin = admin_first;
        while(admin)
        {
                if (admin->trace.detail)
@@ -325,11 +325,8 @@ void end_trace(void)
                                }
 
                                /* create state response */
-                               response = (struct admin_queue *)malloc(sizeof(struct admin_queue)+sizeof(admin_message));
-                               if (!response)
-                                       return;
+                               response = (struct admin_queue *)MALLOC(sizeof(struct admin_queue)+sizeof(admin_message));
                                memuse++;
-                               memset(response, 0, sizeof(admin_queue)+sizeof(admin_message));
                                response->num = 1;
                                /* message */
                                response->am[0].message = ADMIN_TRACE_RESPONSE;
@@ -350,4 +347,3 @@ void end_trace(void)
 
 
 
-