added some utility functions + fixed error in ostrAppendview
This commit is contained in:
parent
aa39e2563d
commit
be71719f73
7 changed files with 47 additions and 18 deletions
|
|
@ -534,7 +534,7 @@ void ostrAppenddouble(str_ostream_t *ctx, double val) {
|
|||
}
|
||||
|
||||
void ostrAppendview(str_ostream_t *ctx, strview_t view) {
|
||||
if((ctx->allocated - ctx->size) < view.len) {
|
||||
if((ctx->allocated - ctx->size) <= view.len) {
|
||||
_ostrRealloc(ctx, view.len + 1);
|
||||
}
|
||||
memcpy(ctx->buf + ctx->size, view.buf, view.len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue