1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-12-27 14:50:23 +05:30

C: pure_getline.c: remove string reallocation

This commit is contained in:
Intel A80486DX2-66 2024-02-20 01:34:07 +03:00
parent d1026e247c
commit f9985a55ce
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -26,15 +26,6 @@ bool pure_getline(char** output) {
return false; 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') { if (character == '\n') {
line[len] = '\0'; line[len] = '\0';
break; break;