diff options
Diffstat (limited to 'common/readline.c')
-rw-r--r-- | common/readline.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/common/readline.c b/common/readline.c index a2c69018..58652429 100644 --- a/common/readline.c +++ b/common/readline.c | |||
@@ -70,28 +70,3 @@ char *peek_line(FILE *file, int line_offset, long *position) { | |||
70 | fseek(file, pos, SEEK_SET); | 70 | fseek(file, pos, SEEK_SET); |
71 | return line; | 71 | return line; |
72 | } | 72 | } |
73 | |||
74 | char *read_line_buffer(FILE *file, char *string, size_t string_len) { | ||
75 | size_t length = 0; | ||
76 | if (!string) { | ||
77 | return NULL; | ||
78 | } | ||
79 | while (1) { | ||
80 | int c = getc(file); | ||
81 | if (c == EOF || c == '\n' || c == '\0') { | ||
82 | break; | ||
83 | } | ||
84 | if (c == '\r') { | ||
85 | continue; | ||
86 | } | ||
87 | string[length++] = c; | ||
88 | if (string_len <= length) { | ||
89 | return NULL; | ||
90 | } | ||
91 | } | ||
92 | if (length + 1 == string_len) { | ||
93 | return NULL; | ||
94 | } | ||
95 | string[length] = '\0'; | ||
96 | return string; | ||
97 | } | ||