From 3f37ff0b65143435f6794d4b2ebed1f28c64e831 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 16 Mar 2020 14:43:30 +1000 Subject: Update to toybox API change. --- src/boxes/boxes.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/boxes/boxes.c b/src/boxes/boxes.c index 25fc880..f07af49 100644 --- a/src/boxes/boxes.c +++ b/src/boxes/boxes.c @@ -539,18 +539,14 @@ void loadFile(struct content *content) if (-1 != fd) { char *temp = NULL; - long len; + long len = 0; do { - // TODO - get_rawline() is slow, and wont help much with DOS and Mac line endings. - temp = get_rawline(fd, &len, '\n'); + // TODO - get_line() is slow, and wont help much with DOS and Mac line endings. + temp = get_line(fd); if (temp) - { - if (temp[len - 1] == '\n') - temp[--len] = '\0'; addLine(content, NULL, temp, len); - } } while (temp); close(fd); } -- cgit v1.1