From f9985a55ce1c236712a3bfd6f41c18e6c2ea9403 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Tue, 20 Feb 2024 01:34:07 +0300 Subject: [PATCH] C: pure_getline.c: remove string reallocation --- c-programming/pure_getline.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/c-programming/pure_getline.c b/c-programming/pure_getline.c index 1411e59..3db5ba0 100644 --- a/c-programming/pure_getline.c +++ b/c-programming/pure_getline.c @@ -26,15 +26,6 @@ bool pure_getline(char** output) { return false; } - char* new_line = realloc(line, (len + 1) * sizeof(char)); - - if (new_line == NULL) { - *output = line; - return false; - } - - line = new_line; - if (character == '\n') { line[len] = '\0'; break;