OSSP CVS Repository

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

Check-in Number: 1307
Date: 2001-Nov-13 13:46:50 (local)
2001-Nov-13 12:46:50 (UTC)
User:simons
Branch:
Comment: The callback will now return a proper error code in case of failure, rather than using exit(1).
Tickets:
Inspections:
Files:
ossp-pkg/var/var_test.c      1.1 -> 1.2     6 inserted, 4 deleted

ossp-pkg/var/var_test.c 1.1 -> 1.2

--- var_test.c   2001/11/13 12:08:30     1.1
+++ var_test.c   2001/11/13 12:46:50     1.2
@@ -4,15 +4,17 @@
 #include "var.h"
 
 int env_lookup(void* context,
-          const char* varname, size_t name_len,
-          const char** data, size_t* data_len, size_t* buffer_size)
+               const char* varname, size_t name_len,
+               const char** data, size_t* data_len, size_t* buffer_size)
     {
     char tmp[256];
 
     if (name_len > sizeof(tmp)-1)
         {
-        printf("Callback can't expand variable names longer than %d characters.\n", sizeof(tmp-1));
-        exit(1);
+        /* Callback can't expand variable names longer than
+           sizeof(tmp) characters. */
+
+        return VAR_CALLBACK_ERROR;
         }
     memcpy(tmp, varname, name_len);
     tmp[name_len] = '\0';

CVSTrac 2.0.1