cvs: pecl /http/phpstr phpstr.c phpstr.h
| From: | Michael Wallner | Date: | Tue, 22 Mar 2005 15:59:42 +0000 |
| Subject: | cvs: pecl /http/phpstr phpstr.c phpstr.h | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-2886@lists.php.net to get a copy of this message | ||
mike Tue Mar 22 10:59:42 2005 EDT
Modified files:
/pecl/http/phpstr phpstr.c phpstr.h
Log:
- use size_t and return 0 on fail
http://cvs.php.net/diff.php/pecl/http/phpstr/phpstr.c?r1=1.2&r2=1.3&ty=u
Index: pecl/http/phpstr/phpstr.c
diff -u pecl/http/phpstr/phpstr.c:1.2 pecl/http/phpstr/phpstr.c:1.3
--- pecl/http/phpstr/phpstr.c:1.2 Mon Mar 21 14:33:38 2005
+++ pecl/http/phpstr/phpstr.c Tue Mar 22 10:59:39 2005
@@ -1,5 +1,5 @@
-/* $Id: phpstr.c,v 1.2 2005/03/21 19:33:38 mike Exp $ */
+/* $Id: phpstr.c,v 1.3 2005/03/22 15:59:39 mike Exp $ */
#include "php.h"
#include "phpstr.h"
@@ -139,10 +139,10 @@
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;
http://cvs.php.net/diff.php/pecl/http/phpstr/phpstr.h?r1=1.3&r2=1.4&ty=u
Index: pecl/http/phpstr/phpstr.h
diff -u pecl/http/phpstr/phpstr.h:1.3 pecl/http/phpstr/phpstr.h:1.4
--- pecl/http/phpstr/phpstr.h:1.3 Mon Mar 21 14:54:14 2005
+++ pecl/http/phpstr/phpstr.h Tue Mar 22 10:59:39 2005
@@ -1,5 +1,5 @@
-/* $Id: phpstr.h,v 1.3 2005/03/21 19:54:14 mike Exp $ */
+/* $Id: phpstr.h,v 1.4 2005/03/22 15:59:39 mike Exp $ */
#ifndef _PHPSTR_H_
#define _PHPSTR_H_
@@ -98,7 +98,7 @@
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);