diff options
Diffstat (limited to 'src/TextFile.cxx')
-rw-r--r-- | src/TextFile.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/TextFile.cxx b/src/TextFile.cxx index ec9c5d442..4ad59ee4a 100644 --- a/src/TextFile.cxx +++ b/src/TextFile.cxx @@ -24,21 +24,14 @@ #include <string.h> char * -read_text_line(FILE *file, GString *buffer) +TextFile::ReadLine() { - enum { - max_length = 512 * 1024, - step = 1024, - }; - gsize length = 0, i; char *p; assert(file != NULL); assert(buffer != NULL); - - if (buffer->allocated_len < step) - g_string_set_size(buffer, step); + assert(buffer->allocated_len >= step); while (buffer->len < max_length) { p = fgets(buffer->str + length, |