diff options
Diffstat (limited to 'ssh/string_view.c')
-rw-r--r-- | ssh/string_view.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ssh/string_view.c b/ssh/string_view.c index 2f4f22a..ba05236 100644 --- a/ssh/string_view.c +++ b/ssh/string_view.c @@ -70,3 +70,10 @@ void sv_skip_whitespace(struct string_view *line) { line->len--; } } + +void sv_skip(struct string_view *line, size_t num) { + if (!line->s) return; + if (num > line->len) num = line->len; + line->s += num; + line->len -= num; +} |