X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=phpstr%2Fphpstr.c;h=7c9bad0970f42a54e259b915278d6d11823a7224;hp=af090fa02d16aadb2d1139e9c3f3ba9e168d7175;hb=1877c25f3174e7ec12dfcfe2797e2454bd9d94eb;hpb=0f08208cc1b223ccb90554718181d553156997f4;ds=sidebyside 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;