* Depends on glibc 2.10 for getline().
*/
+#define _GNU_SOURCE
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
char *line = NULL, *nl;
size_t linesize;
+ memset(&pos, 0, sizeof(pos));
ctf_init_pos(&pos, output, O_RDWR);
write_packet_header(&pos, s_uuid);
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);
}