dj(1): remove Io_bufalloc
This commit is contained in:
parent
1cf67af281
commit
76252305f9
11
src/dj.c
11
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;
|
||||
|
Loading…
Reference in New Issue
Block a user