diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-19 16:27:29 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-19 16:27:29 +0200 |
| commit | a407fe611354d71330fc352fbc2a9fe268b4104f (patch) | |
| tree | 21433e38b4f7d3da066f94b53eee265af969a9d6 /get_next_line.h | |
| parent | e0abc6358c4cacc840ac8b3a9a92900f8ce49f0a (diff) | |
| download | get_next_line-a407fe611354d71330fc352fbc2a9fe268b4104f.tar.gz get_next_line-a407fe611354d71330fc352fbc2a9fe268b4104f.tar.bz2 get_next_line-a407fe611354d71330fc352fbc2a9fe268b4104f.zip | |
Removed dynamic rest
Because if user doesnt read a file until the end, this would cause
memory leak.
All moulitest tests pass except for large file with certain buffer sizes
greater than the line len and smaller than the file len.
Diffstat (limited to 'get_next_line.h')
| -rw-r--r-- | get_next_line.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/get_next_line.h b/get_next_line.h index 9f7aabd..619cb9b 100644 --- a/get_next_line.h +++ b/get_next_line.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/09 13:52:59 by cacharle #+# #+# */ -/* Updated: 2019/10/11 14:27:22 by cacharle ### ########.fr */ +/* Updated: 2019/10/19 16:24:03 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,7 @@ # define GET_NEXT_LINE_H # ifndef BUFFER_SIZE -# define BUFFER_SIZE 32 +# define BUFFER_SIZE 100000 # endif # define LINE_READ 1 @@ -26,14 +26,14 @@ typedef int t_bool; +#include <stdio.h> /* ** get_next_line.c */ int get_next_line(int fd, char **line); -char *shift_rest(char *rest, int split_at); +char *put_rest(char *line, char *rest); int find_newline(char *str); -t_bool empty_rest(char *rest); /* ** get_next_line_utils.c - helper functions |
