summaryrefslogtreecommitdiff
path: root/command/tail.c
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-14 21:43:02 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-14 21:43:02 -0400
commite735ad6710a82604a206ad29f6cbcdd7dc4b024c (patch)
tree5fe8eebbb7a2bff20bb71bd2368955356979e0a2 /command/tail.c
parentsync (diff)
downloadlazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.tar.gz
lazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.tar.bz2
lazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.zip
refactor and add su
Diffstat (limited to 'command/tail.c')
-rw-r--r--command/tail.c6
1 files changed, 3 insertions, 3 deletions
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;