Fix babeltrace-log get big line when the input file last line don't have enter
[babeltrace.git] / converter / babeltrace-log.c
index 7f31d015226548969abfa515046ece454732dce9..f7eb5f768d39c88425f3bff276374f8ba47e9074 100644 (file)
@@ -240,9 +240,12 @@ void trace_text(FILE *input, int output)
                if (len < 0)
                        break;
                nl = strrchr(line, '\n');
-               if (nl)
+               if (nl) {
                        *nl = '\0';
-               trace_string(line, &pos, nl - line + 1);
+                       trace_string(line, &pos, nl - line + 1);
+               } else {
+                       trace_string(line, &pos, strlen(line) + 1);
+               }
        }
        ctf_fini_pos(&pos);
 }
This page took 0.024083 seconds and 4 git commands to generate.