From 7115f4539b7d08ec21c5e6132841b2613a74059d Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 29 Dec 2021 12:52:21 +0100 Subject: Update of README.md docs describing version 3. --- include/stc/csview.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/stc/csview.h b/include/stc/csview.h index 69de5749..c4844bfb 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -143,8 +143,8 @@ STC_DEF csview csview_token(csview sv, csview sep, size_t* start) { csview slice = {sv.str + *start, sv.size - *start}; const char* res = c_strnstrn(slice.str, sep.str, slice.size, sep.size); - csview tok = {slice.str, (res ? res - slice.str : slice.size)}; - *start += tok.size + (res ? sep.size : 0); + csview tok = {slice.str, res ? res - slice.str : (sep.size = 0, slice.size)}; + *start += tok.size + sep.size; return tok; } -- cgit v1.2.3