aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 1ef27e6f64..f5ddfa68da 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -212,12 +212,15 @@ static int perform_file_scan(const char *ast_file, const char *source_file) {
start_col = last_col = 1;
while (!feof(fp)) {
- size_t len;
- const char *buf;
-
- if ((buf = fgetln(fp, &len)) == NULL)
- break;
-
+ size_t len = 0;
+ int c;
+
+ while ((c = fgetc(fp)) != EOF) {
+ len++;
+ if (c == '\n')
+ break;
+ }
+
++line;
for (i = 0; i < len ; ++i) {