return dup;
}
-PHPSTR_API ssize_t phpstr_cut(phpstr *buf, size_t offset, size_t length)
+PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length)
{
if (offset >= buf->used) {
- return -1;
+ return 0;
}
if (offset + length > buf->used) {
length = buf->used - offset;
PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t len);
/* remove a substring */
-PHPSTR_API ssize_t phpstr_cut(phpstr *buf, size_t offset, size_t length);
+PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length);
/* get a complete phpstr duplicate */
PHPSTR_API phpstr *phpstr_dup(const phpstr *buf);