summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2013-12-22 00:39:47 +0100
committerOlivier Gayot <duskcoder@gmail.com>2014-01-18 13:44:20 +0100
commitffcd1f19269c30fdec2a8db3756e4d0b84e815b1 (patch)
tree6e09e36c4ddd592dc3d6dc7673b6b3e3fd90f895
parent0aac38f5b25f25b2472f991e3275dc976a9aa47e (diff)
rb: use the rb_remove function where it needs to be
-rw-r--r--src/rb_str.c10
1 files 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);