projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- use size_t and return 0 on fail
[m6w6/ext-http]
/
phpstr
/
phpstr.c
diff --git
a/phpstr/phpstr.c
b/phpstr/phpstr.c
index af090fa02d16aadb2d1139e9c3f3ba9e168d7175..7c9bad0970f42a54e259b915278d6d11823a7224 100644
(file)
--- a/
phpstr/phpstr.c
+++ b/
phpstr/phpstr.c
@@
-139,10
+139,10
@@
PHPSTR_API phpstr *phpstr_dup(const phpstr *buf)
return dup;
}
return dup;
}
-PHPSTR_API s
s
ize_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;