From b70b356ce5ec6a78f029a8db0df6b5a3d3944827 Mon Sep 17 00:00:00 2001 From: DTB Date: Wed, 26 Jun 2024 12:45:50 -0600 Subject: [PATCH] dj(1): remove Io_buffree --- src/dj.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/dj.c b/src/dj.c index 7c0b7c3..01832a8 100644 --- a/src/dj.c +++ b/src/dj.c @@ -67,8 +67,8 @@ static int write_flags = O_WRONLY | O_CREAT; * particular io[2] used in main. Error conditions are not checked because this * is only used when the program is about to terminate (hence its name). */ #define terminate(io) do{ \ - Io_buffree(&(io)[0]); \ - Io_buffree(&(io)[1]); \ + free((io[0]).buf); \ + free((io[1]).buf); \ Io_fdclose(&(io)[0]); \ Io_fdclose(&(io)[1]); }while(0) @@ -79,15 +79,6 @@ Io_bufalloc(struct Io *io){ return (io->buf = malloc(io->bs * (sizeof *io->buf))); } -/* Frees *io's buffer. Returns io. */ -static struct Io * -Io_buffree(struct Io *io){ - - free(io->buf); - - return io; -} - /* Fills the unused portion of io's buffer with padding, updating io->bufuse. * Returns io. */ static struct Io *