* 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:
snarmph 2021-10-06 00:13:10 +02:00
parent bb5cce33f0
commit c4d1ffe539
15 changed files with 451 additions and 88 deletions

View file

@ -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';
}