OSSP CVS Repository

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

Check-in Number: 1442
Date: 2001-Dec-17 13:57:46 (local)
2001-Dec-17 12:57:46 (UTC)
User:rse
Branch:
Comment: allow result_len to be NULL
Tickets:
Inspections:
Files:
ossp-pkg/var/var.c      1.56 -> 1.57     5 inserted, 3 deleted
ossp-pkg/var/var.pod      1.16 -> 1.17     2 inserted, 1 deleted

ossp-pkg/var/var.c 1.56 -> 1.57

--- var.c        2001/12/17 10:29:43     1.56
+++ var.c        2001/12/17 12:57:46     1.57
@@ -2020,7 +2020,7 @@
 
     /* Argument sanity checks */
     if (input_buf == NULL || input_len == 0 ||
-        result == NULL || result_len == NULL ||
+        result == NULL ||
         lookup == NULL)
         return VAR_ERR_INVALID_ARGUMENT;
 
@@ -2060,7 +2060,8 @@
 
         /* Provide results */
         *result = (char *)output.begin;
-        *result_len = output.end - output.begin;
+        if (result_len != NULL)
+            *result_len = output.end - output.begin;
 
         /* canonify all positive answers */
         rc = VAR_OK;
@@ -2068,7 +2069,8 @@
     else {
         /* Provide error results */
         *result = (char *)input_buf;
-        *result_len = output.end - output.begin; /* FIXME */
+        if (result_len != NULL)
+            *result_len = output.end - output.begin;
     }
 
     return rc;


ossp-pkg/var/var.pod 1.16 -> 1.17

--- var.pod      2001/12/17 10:29:43     1.16
+++ var.pod      2001/12/17 12:57:46     1.17
@@ -180,7 +180,8 @@
 buffer will be stored. If var_expand() fails with an error -- with the
 exception of VAR_ERR_INVALID_ARGUMENT and VAR_ERR_OUT_OF_MEMORY --,
 "result_len" will contain the number of characters that have been
-consumed from "input" before the error occured.
+consumed from "input" before the error occured. This argument can be
+NULL if the application is not interested in this information.
 
 =item var_cb_t lookup
 

CVSTrac 2.0.1