OSSP CVS Repository

ossp - Check-in [4248]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4248
Date: 2001-Aug-01 11:22:50 (local)
2001-Aug-01 09:22:50 (UTC)
User:simons
Branch:
Comment: Initialize the elements of xds_context explicitely rather than relying on calloc(). This increases chances of portability.
Tickets:
Inspections:
Files:
ossp-pkg/xds/init.c      1.4 -> 1.5     15 inserted, 2 deleted

ossp-pkg/xds/init.c 1.4 -> 1.5

--- init.c       2001/07/08 15:22:00     1.4
+++ init.c       2001/08/01 09:22:50     1.5
@@ -45,7 +45,7 @@
 
     /* Allocate context structure. */
 
-    ctx = calloc(1, sizeof(struct xds_context));
+    ctx = malloc(sizeof(struct xds_context));
     if (ctx == NULL)
         return NULL;            /* errno is set by calloc() */
 
@@ -53,7 +53,20 @@
 
     ctx->mode = mode;
 
-    /* We are initialized. */
+    /* Initialize buffer handling. */
+
+    ctx->buffer = NULL;
+    ctx->buffer_len = 0;
+    ctx->buffer_capacity = 0;
+    ctx->we_own_buffer = XDS_FALSE;
+
+    /* Initialize engines map. */
+
+    ctx->engines = NULL;
+    ctx->engines_len = 0;
+    ctx->engines_capacity = 0;
+
+    /* Done. */
 
     return ctx;
     }

CVSTrac 2.0.1