From 1877c25f3174e7ec12dfcfe2797e2454bd9d94eb Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 22 Mar 2005 15:59:39 +0000 Subject: [PATCH] - use size_t and return 0 on fail --- phpstr/phpstr.c | 4 ++-- phpstr/phpstr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; diff --git a/phpstr/phpstr.h b/phpstr/phpstr.h index bd749d6..c53d311 100644 --- a/phpstr/phpstr.h +++ b/phpstr/phpstr.h @@ -98,7 +98,7 @@ PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length); 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); -- 2.30.2