Current toolchains warn about unused result from fread, so mitigate
the edge case if fread returns short data. It's not great, but it
gets things building again.
+2021-02-13 Mike Frysinger <vapier@gentoo.org>
+
+ * trace.c (load_file_and_line): Use fread return value to index
+ the data.
+
2021-02-13 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Replace sinclude with AC_CONFIG_MACRO_DIRS.
FILE *file;
int i;
struct stat s;
+ size_t ret;
const char *found_filename, *slash;
found_filename = filename;
f->filename = strdup (filename);
f->data = (char *) malloc (s.st_size + 2);
file = fopen (found_filename, "rb");
- fread (f->data, 1, s.st_size, file);
- f->data[s.st_size] = 0;
+ ret = fread (f->data, 1, s.st_size, file);
+ f->data[ret] = 0;
fclose (file);
f->nlines = 1;