OSSP CVS Repository

ossp - Difference in ossp-pkg/xds/xdr-decode-octetstream.c versions 1.3 and 1.3.2.1
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/xds/xdr-decode-octetstream.c 1.3 -> 1.3.2.1

--- xdr-decode-octetstream.c     2001/07/23 15:33:42     1.3
+++ xdr-decode-octetstream.c     2001/08/01 11:26:56     1.3.2.1
@@ -29,7 +29,9 @@
 #include <assert.h>
 #include "internal.h"
 
-int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args)
+int xdr_decode_octetstream(xds_t* xds, void* engine_context,
+                           void* buffer, size_t buffer_size, size_t* used_buffer_size,
+                           va_list* args)
     {
     void**  p;
     size_t* p_len;
@@ -37,12 +39,11 @@
 
     /* Consistency checks. */
 
-    assert(xds != NULL);
-    assert(buffer != NULL);
-    assert(buffer_size != 0);
-    assert(args != NULL);
-    if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL)
-        return XDS_ERR_INVALID_ARG;
+    xds_check_parameter(xds != NULL);
+    xds_check_parameter(buffer != NULL);
+    xds_check_parameter(buffer_size != 0);
+    xds_check_parameter(used_buffer_size != NULL);
+    xds_check_parameter(args != NULL);
 
     /* Get pointers from the stack. */
 
@@ -71,6 +72,8 @@
 
     if (buffer_size < 4 + *p_len + padding)
         return XDS_ERR_UNDERFLOW;
+    else
+        *used_buffer_size = 4 + *p_len + padding;
 
     /* Allocate buffer for the data. */
 
@@ -84,5 +87,5 @@
 
     /* Done. */
 
-    return 4 + *p_len + padding;
+    return XDS_OK;
     }

CVSTrac 2.0.1