Fix not NULL pointer on size 0
[lttng-tools.git] / lttng / commands / list.c
index c73ea74dc457f504775abede040a1a3cceb7aec4..50dad9a2b4efc3aa57cb747c72820cea36773add 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <assert.h>
 
 #include "../cmd.h"
 
@@ -185,6 +186,10 @@ static int list_events(const char *channel_name)
                                MSG("%s (type: noop) [enabled: %d]", indent6,
                                                events[i].enabled);
                                break;
+                       case LTTNG_EVENT_ALL:
+                               /* We should never have "all" events in list. */
+                               assert(0);
+                               break;
                }
        }
 
@@ -262,7 +267,7 @@ static int list_channels(const char *channel_name)
                /* Listing events per channel */
                ret = list_events(channels[i].name);
                if (ret < 0) {
-                       MSG("%s", lttng_get_readable_code(ret));
+                       MSG("%s", lttng_strerror(ret));
                }
 
                if (chan_found) {
This page took 0.024326 seconds and 5 git commands to generate.