util.c: munmap takes a pointer, not a file descriptor.

The first argument to munmap(2) should be a pointer to
an mmap'ed region, not a file descriptor.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
This commit is contained in:
Dan Cross 2018-10-15 14:37:48 +00:00 committed by Andrew Pamment
parent 3519368d37
commit 69c7286ea7

View File

@ -66,7 +66,7 @@ stralloc file2stralloc(const char *path) {
}
stralloc sa = EMPTY_STRALLOC;
stralloc_copyb(&sa, p, len);
munmap(fd, len);
munmap(p, len);
close(fd);
return sa;