From f4a06d40e7ee3b7b0b680012fafeab6269fb1c15 Mon Sep 17 00:00:00 2001 From: ado Date: Sun, 25 Feb 2024 10:53:21 +0100 Subject: [PATCH] Fix non-POSIX get_line --- include/ss/common.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ss/common.hpp b/include/ss/common.hpp index 97b55b4..00ae9fb 100644 --- a/include/ss/common.hpp +++ b/include/ss/common.hpp @@ -55,7 +55,7 @@ ssize_t get_line_file(char** lineptr, size_t* n, FILE* fp) { if (*lineptr == nullptr || *n < sizeof(buff)) { size_t new_n = sizeof(buff); - lineptr = static_cast(strict_realloc(*lineptr, new_n)); + *lineptr = static_cast(strict_realloc(*lineptr, new_n)); *n = new_n; } @@ -69,7 +69,7 @@ ssize_t get_line_file(char** lineptr, size_t* n, FILE* fp) { if (*n <= buff_used + line_used) { size_t new_n = *n * 2; - lineptr = static_cast(realloc(*lineptr, new_n)); + *lineptr = static_cast(strict_realloc(*lineptr, new_n)); *n = new_n; }