diff options
| author | iamcheeseman <[email protected]> | 2026-04-07 10:47:58 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-04-07 10:47:58 -0400 |
| commit | e0f38c44e9888c9efd1487e8d1ba9d7e5d845e1d (patch) | |
| tree | f3c35a2bb5a74ffa22cbaff08b39695f0ffc96e8 | |
| parent | 6157e460ab9004867c71ceb3e72c1fbad530928b (diff) | |
microscript: fix order of operations
| -rw-r--r-- | uscript/val.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/uscript/val.c b/uscript/val.c index 6b2fa9b..77f7753 100644 --- a/uscript/val.c +++ b/uscript/val.c @@ -180,7 +180,7 @@ char *val_to_str(struct us_val v, int *len_out) } case VAL_STR: { const struct us_str *us_str = get_str(v); - char *str = mem_alloc(sizeof(char) * us_str->len + 1); + char *str = mem_alloc(sizeof(char) * (us_str->len + 1)); strncpy(str, us_str->chars, us_str->len); str[us_str->len] = 0; if (len_out) |
