mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
extract: finish: increase ‘idx’ when pushing new data, for consistency
We don’t write anything more to the buffer after this, but this makes this code consistent with all other code that pushes new data to the buffer. This makes it easier to search, and validate, the ensure_size()+push-data pattern.
This commit is contained in:
parent
07078da0f0
commit
fd5d68c819
1 changed files with 2 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ extract_finish(struct extraction_context *ctx, char **text, size_t *len)
|
|||
/* Selection of empty cells only */
|
||||
if (!ensure_size(ctx, 1))
|
||||
goto out;
|
||||
ctx->buf[ctx->idx] = L'\0';
|
||||
ctx->buf[ctx->idx++] = L'\0';
|
||||
} else {
|
||||
assert(ctx->idx > 0);
|
||||
assert(ctx->idx <= ctx->size);
|
||||
|
|
@ -78,7 +78,7 @@ extract_finish(struct extraction_context *ctx, char **text, size_t *len)
|
|||
else {
|
||||
if (!ensure_size(ctx, 1))
|
||||
goto out;
|
||||
ctx->buf[ctx->idx] = L'\0';
|
||||
ctx->buf[ctx->idx++] = L'\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue