summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2019-05-14 17:19:47 +0100
committerFreeArtMan <dos21h@gmail.com>2019-05-14 17:19:47 +0100
commit2e06ffc51227fb9d613f6e068ffe04e0c4a23cb9 (patch)
tree8935e82ce4c85740b07499fb96194c6d636f3ae5
parente02f131fdec629a043471962d7137ed929b2a6a1 (diff)
downloadlibbuf-2e06ffc51227fb9d613f6e068ffe04e0c4a23cb9.tar.gz
libbuf-2e06ffc51227fb9d613f6e068ffe04e0c4a23cb9.zip
BufLine when return line, dont return seperate character, shift out seperator character
-rw-r--r--buf_misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/buf_misc.c b/buf_misc.c
index 5fbcd63..d3c540e 100644
--- a/buf_misc.c
+++ b/buf_misc.c
@@ -94,7 +94,8 @@ int BufLine::pop_line(char **val, int *size)
int idx;
if (1 == buf->findc('\n',&idx))
{
- buf->popsubstring(idx+1,val,size);
+ buf->popsubstring(idx,val,size);
+ buf->shiftleft(1);//remove seperator character
return 0;
}
return -1;