From 571b24e14566d6af359e89f53691c7d118761560 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 18 Sep 2020 22:49:02 -0700 Subject: Slightly better handling of NULL bytes --- file_loader.c | 1 + 1 file changed, 1 insertion(+) (limited to 'file_loader.c') diff --git a/file_loader.c b/file_loader.c index 5d231d3..0ce4b4c 100644 --- a/file_loader.c +++ b/file_loader.c @@ -33,6 +33,7 @@ file_t *load_file(const char *filename) f->contents = realloc(f->contents, sizeof(char)*(capacity *= 2) + 1); } f->contents[f->length] = '\0'; + f->end = &f->contents[f->length]; close(fd); // Calculate line numbers: -- cgit v1.2.3