From ffcd1f19269c30fdec2a8db3756e4d0b84e815b1 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 22 Dec 2013 00:39:47 +0100 Subject: rb: use the rb_remove function where it needs to be --- src/rb_str.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/rb_str.c b/src/rb_str.c index b80628f..07b2844 100644 --- a/src/rb_str.c +++ b/src/rb_str.c @@ -31,8 +31,7 @@ static char *__rb_gets2(t_rb *rb, const char *const *delim, if (b_ptr != NULL) { ret = strndup((const char *)data, (size_t)b_ptr - (size_t)data); - /* TODO replace with an appropriate function */ - rb_get(rb, NULL, (size_t)b_ptr - (size_t)data + b_len); + rb_remove(rb, (size_t)b_ptr - (size_t)data + b_len); } return ret; @@ -73,11 +72,8 @@ char *rb_gets(t_rb *rb, const char *delimit) if (ptr != NULL) { ret = strndup(data, (size_t)ptr - (size_t)data); - /* - * TODO replace by a function which only removes data from the - * ring buffer - */ - rb_get(rb, data, (size_t)ptr - (size_t)data + strlen(delimit)); + + rb_remove(rb, (size_t)ptr - (size_t)data + strlen(delimit)); } free(data); -- cgit v1.2.3