From e735ad6710a82604a206ad29f6cbcdd7dc4b024c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sun, 14 May 2023 21:43:02 -0400 Subject: refactor and add su --- command/tail.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'command/tail.c') diff --git a/command/tail.c b/command/tail.c index 8137eca..64f4608 100644 --- a/command/tail.c +++ b/command/tail.c @@ -23,10 +23,10 @@ static size_t tail_file_lines(FILE* file, unsigned int count, size_t skip) { size_t len; char* line; - ring = malloc(sizeof(char*) * count); + ring = xalloc(sizeof(char*) * count); memset(ring, 0, sizeof(char*) * count); - ring_len = malloc(sizeof(int) * count); + ring_len = xalloc(sizeof(int) * count); index = 0; size = 0; @@ -74,7 +74,7 @@ static size_t tail_file_chars(FILE* file, unsigned int count, size_t skip) { unsigned int size, i; int read, c; - ring = malloc(sizeof(char) * count); + ring = xalloc(sizeof(char) * count); memset(ring, 0, count); index = 0; -- cgit v1.2.3-freya