diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-18 22:49:02 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-18 22:49:02 -0700 |
| commit | 571b24e14566d6af359e89f53691c7d118761560 (patch) | |
| tree | c57fdf457abc8e5b04d86d32e5073de7f6014b07 /file_loader.c | |
| parent | 204185ac43f74160e20129e08af353563a40488e (diff) | |
Slightly better handling of NULL bytes
Diffstat (limited to 'file_loader.c')
| -rw-r--r-- | file_loader.c | 1 |
1 files changed, 1 insertions, 0 deletions
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: |
