grab_fd and grab_file: add a size arg, use everywhere.
[ccan] / tools / ccanlint / file_analysis.c
index 1341e57b11d3230780704ead95a0e123deb10042..bee99597310c346f5b8a291f40858de41b8605d5 100644 (file)
 
 char **get_ccan_file_lines(struct ccan_file *f)
 {
-       if (!f->lines)
-               f->lines = get_file_lines(f, f->name, &f->num_lines);
+       if (!f->lines) {
+               char *buffer = grab_file(f, f->name, NULL);
+               if (!buffer)
+                       err(1, "Getting file %s", f->name);
+               f->lines = strsplit(f, buffer, "\n", &f->num_lines);
+       }
        return f->lines;
 }