Remove logically dead code
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 18 Jun 2013 19:38:57 +0000 (15:38 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 19 Jun 2013 18:47:22 +0000 (14:47 -0400)
1019963 Logically dead code
In list_sessions: Code can never be reached because of a logical
contradiction (CWE-561)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng/commands/list.c

index db993df75d8d15b111fb0f4a6c93a74bd8073c0c..c96d27c2aad8bada8657687993412f8f9d25bfc8 100644 (file)
@@ -624,14 +624,9 @@ static int list_sessions(const char *session_name)
                                MSG("%sTrace path: %s\n", indent4, sessions[i].path);
                                break;
                        }
-                       continue;
-               }
-
-               MSG("  %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
-                               active_string(sessions[i].enabled));
-
-               if (session_found) {
-                       break;
+               } else {
+                       MSG("  %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
+                                       active_string(sessions[i].enabled));
                }
        }
 
This page took 0.027048 seconds and 4 git commands to generate.