OSSP CVS Repository

ossp - Difference in ossp-pkg/xds/vencode.c versions 1.12.2.4 and 1.12.2.5
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/xds/vencode.c 1.12.2.4 -> 1.12.2.5

--- vencode.c    2001/08/01 13:26:29     1.12.2.4
+++ vencode.c    2001/08/01 14:37:32     1.12.2.5
@@ -42,7 +42,7 @@
 
     xds_check_parameter(xds != NULL);
     xds_check_parameter(fmt_arg != NULL);
-    xds_check_parameter(xds->mode == XDS_ENCODE);
+    assert(xds->mode == XDS_ENCODE);
     if (xds->mode != XDS_ENCODE)
         return XDS_ERR_INVALID_MODE;
 
@@ -117,6 +117,7 @@
 
                 /* Execute the engine. */
 
+                used_buffer_size = 0;
                 args_backup = args;
                 rc = (*xds->engines[pos].engine)(xds,
                                                  xds->engines[pos].context,
@@ -140,7 +141,7 @@
 
                     rc = xds_set_capacity((void**)&xds->buffer,
                                           &xds->buffer_capacity,
-                                          xds->buffer_capacity + 1,
+                                          xds->buffer_capacity + ((used_buffer_size == 0) ? 1 : used_buffer_size),
                                           sizeof(char),
                                           XDS_INITIAL_BUFFER_CAPACITY);
                     assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM);

CVSTrac 2.0.1