summaryrefslogtreecommitdiff
path: root/buf_misc.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2019-05-12 15:36:00 +0100
committerFreeArtMan <dos21h@gmail.com>2019-05-12 15:36:00 +0100
commit709c4bd0e02a0dcb609b841053da9624f41440cc (patch)
tree628518c61a3acdf5f5be83e0301e0fe641013efe /buf_misc.c
parent082dee0658b67744ab3428eea964f375f7aab9dc (diff)
downloadlibbuf-709c4bd0e02a0dcb609b841053da9624f41440cc.tar.gz
libbuf-709c4bd0e02a0dcb609b841053da9624f41440cc.zip
Added to BufLine new line detection
Diffstat (limited to 'buf_misc.c')
-rw-r--r--buf_misc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/buf_misc.c b/buf_misc.c
index dee1b04..b42e2e9 100644
--- a/buf_misc.c
+++ b/buf_misc.c
@@ -86,12 +86,18 @@ int BufLine::add(char *string, int size)
int BufLine::add(Buf *newdata)
{
buf->concat(newdata);
- return -1;
+ return 0;
}
int BufLine::pop_line(char **val, int *size)
{
-
+ int idx;
+ if (1 == buf->findc('\n',&idx))
+ {
+ printf("")
+ buf->popsubstring(4,val,size);
+ return 0;
+ }
return -1;
}