support set of non terminated string (with len)
This commit is contained in:
parent
bf2c598f63
commit
90c3473406
1 changed files with 2 additions and 1 deletions
|
|
@ -1053,6 +1053,7 @@ capn_ptr capn_new_string(struct capn_segment *seg, const char *str, ssize_t sz)
|
|||
new_object(&p, p.len);
|
||||
if (p.data) {
|
||||
memcpy(p.data, str, p.len - 1);
|
||||
p.data[p.len - 1] = '\0';
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue