added:
* file: small wrap over winapi for windows and stdio for posix * fs: small wrapper over stat * slice: slice macro type modified: * str and strview are now slices
This commit is contained in:
parent
bb5cce33f0
commit
c4d1ffe539
15 changed files with 451 additions and 88 deletions
|
|
@ -504,10 +504,10 @@ void ostrAppenddouble(str_ostream_t *ctx, double val) {
|
|||
}
|
||||
|
||||
void ostrAppendview(str_ostream_t *ctx, strview_t view) {
|
||||
if((ctx->allocated - ctx->size) < view.size) {
|
||||
_ostrRealloc(ctx, view.size + 1);
|
||||
if((ctx->allocated - ctx->size) < view.len) {
|
||||
_ostrRealloc(ctx, view.len + 1);
|
||||
}
|
||||
memcpy(ctx->buf + ctx->size, view.buf, view.size);
|
||||
ctx->size += view.size;
|
||||
memcpy(ctx->buf + ctx->size, view.buf, view.len);
|
||||
ctx->size += view.len;
|
||||
ctx->buf[ctx->size] = '\0';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue