- use size_t and return 0 on fail
[m6w6/ext-http] / phpstr / phpstr.c
index af090fa02d16aadb2d1139e9c3f3ba9e168d7175..7c9bad0970f42a54e259b915278d6d11823a7224 100644 (file)
@@ -139,10 +139,10 @@ PHPSTR_API phpstr *phpstr_dup(const phpstr *buf)
        return dup;
 }
 
        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) {
 {
        if (offset >= buf->used) {
-               return -1;
+               return 0;
        }
        if (offset + length > buf->used) {
                length = buf->used - offset;
        }
        if (offset + length > buf->used) {
                length = buf->used - offset;