mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-05-31 08:31:41 +05:30
C: pure_getline.c: remove string reallocation
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user