X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=phpstr%2Fphpstr.c;h=7c9bad0970f42a54e259b915278d6d11823a7224;hb=0f630c2603d758b77b4eb939f5c954d5149b369f;hp=af090fa02d16aadb2d1139e9c3f3ba9e168d7175;hpb=af674f03c32f0f56b7f8c67e61c7e86b3ea23be5;p=m6w6%2Fext-http diff --git a/phpstr/phpstr.c b/phpstr/phpstr.c index af090fa..7c9bad0 100644 --- a/phpstr/phpstr.c +++ b/phpstr/phpstr.c @@ -139,10 +139,10 @@ PHPSTR_API phpstr *phpstr_dup(const phpstr *buf) 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;