commit 61092e9793916d82c90a2950843e1bcb889ac8f4
parent 09aaf2e885c7b716e072f1d3118120589437aff6
Author: Claudio Alessi <smoppy@gmail.com>
Date: Mon, 25 Apr 2016 13:44:51 +0200
Fix *sz in fget().
This is correct but reintroduce a weird bug about removing a single space from
an editing record. I'll investigate.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/myadm.c b/myadm.c
@@ -372,7 +372,7 @@ fget(char *fn, int *sz) {
fd = open(fn, O_RDONLY);
if(fd == -1)
return NULL;
- *sz = lseek(fd, 0, SEEK_END)+1;
+ *sz = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
buf = ecalloc(1, *sz);
read(fd, buf, *sz);