diff --git a/src/dj.c b/src/dj.c index e5f276b..2e565ce 100644 --- a/src/dj.c +++ b/src/dj.c @@ -65,15 +65,6 @@ static int write_flags = O_WRONLY | O_CREAT; || (fd) == STDOUT_FILENO \ || (fd) == STDERR_FILENO) -/* Allocates *io's buffer. Returns NULL if unsuccessful. */ -static void * -Io_bufalloc(struct Io *io){ - - return io != NULL - ? (io->buf = malloc(io->bs * (sizeof *io->buf))) - : NULL; -} - /* Fills the unused portion of io's buffer with padding, updating io->bufuse. * Returns io. */ static struct Io * @@ -324,7 +315,7 @@ int main(int argc, char *argv[]){ } for(i = 0; i < 2; ++i){ - if(Io_bufalloc(&io[i]) == NULL){ + if((io[i].buf = malloc(io[i].bs * (sizeof *(io[i].buf)))) == NULL){ fprintf(stderr, "%s: Failed to allocate %d bytes\n", program_name, io[i].bs); return EX_OSERR;