char *str = NULL;
int size = 0;
int i;
- int r;
+ s64 r;
for (;;) {
r = read(input_fd, buf, BUFSIZ);
i++;
/* move the file descriptor to the end of the string */
- r = lseek(input_fd, -(r - i), SEEK_CUR);
+ r = lseek64(input_fd, -(r - i), SEEK_CUR);
if (r < 0)
die("lseek");
if (!size)
return;
- buf = malloc_or_die(size);
+ buf = malloc_or_die(size + 1);
read_or_die(buf, size);
+ buf[size] = '\0';
parse_proc_kallsyms(buf, size);
read_or_die(buf, 3);
if (memcmp(buf, test, 3) != 0)
- die("not an trace data file");
+ die("no trace data in the file");
read_or_die(buf, 7);
if (memcmp(buf, "tracing", 7) != 0)
- die("not a trace file (missing tracing)");
+ die("not a trace file (missing 'tracing' tag)");
version = read_string();
if (show_version)