diff options
| author | 2022-08-15 12:22:47 +0200 | |
|---|---|---|
| committer | 2022-08-15 12:22:47 +0200 | |
| commit | f906d0b350b0b4ceb747669c9a9845d11bd0e486 (patch) | |
| tree | 5f09a7b714e6ce93f6094a06e5f736513110fb8d /bootstrap/util.c | |
| parent | f802bb99263aaa5be492999babd44cd2fdb1c65f (diff) | |
self hosted progress
Diffstat (limited to 'bootstrap/util.c')
| -rw-r--r-- | bootstrap/util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bootstrap/util.c b/bootstrap/util.c index da838b5..b64485b 100644 --- a/bootstrap/util.c +++ b/bootstrap/util.c @@ -112,7 +112,8 @@ eprifileline(struct span span) { close(fd); return; } - filemmaps[span.fileid] = src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + // XXX this maybe causes SIGBUS later if we're at last line + no ending newline + st_size multiple of 4096 + filemmaps[span.fileid] = src = mmap(NULL, st.st_size + 1, PROT_READ, MAP_PRIVATE, fd, 0); assert(src && src != (void *)-1 && "mmap"); close(fd); } |