apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject apr_bucket_simple_split
Date Sat, 25 Aug 2001 21:09:14 GMT

Somebody please explain this commit to me:

===================================================================
RCS file: /home/cvspublic/apr-util/buckets/apr_buckets_simple.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- apr-util/buckets/apr_buckets_simple.c	2001/06/19 18:48:32	1.29
+++ apr-util/buckets/apr_buckets_simple.c	2001/07/24 20:36:03	1.30
@@ -67,12 +67,12 @@
 }

 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *a,
-                                                         apr_off_t point)
+                                                         apr_size_t point)
 {
     apr_bucket *b;
     apr_status_t rv;

-    if (point < 0 || point > a->length) {
+    if ((point > a->length) || (a->length == (apr_size_t)(-1))) {
 	return APR_EINVAL;
     }


Why check to see if a->length is -1?  That's a waste of time.  If
a->length is -1, the bucket type should have never registered a split
function in the first place.  What we really want to know is if point is
before the beginning of the bucket or after the end of the bucket.  The
original test gave us that.

What am I missing?

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message