support set of non terminated string (with len)

This commit is contained in:
Michael Gartsbein 2016-04-06 11:40:18 +03:00
parent bf2c598f63
commit 90c3473406

View file

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