sterling                Wed Jan 17 06:14:22 2001 EDT

  Modified files:              
    /php4/ext/sablot    sablot.c 
  Log:
  Fix (well it works) the error display with sablotron.
  
  
  
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.30 php4/ext/sablot/sablot.c:1.31
--- php4/ext/sablot/sablot.c:1.30       Wed Jan 17 03:43:17 2001
+++ php4/ext/sablot/sablot.c    Wed Jan 17 06:14:22 2001
@@ -1394,27 +1394,16 @@
 
 static void _php_sablot_standard_error(php_sablot_error *errors, php_sablot_error 
errors_start, int code, int level)
 {
-    int len = 0,
-        pos = 0;
     char *errstr = NULL;
     SABLOTLS_FETCH();
     
     errors = errors_start.next;
     while (errors) {
-        len = pos + strlen(errors->key) + sizeof(": ") + strlen(errors->value) + 
sizeof("\n");
-        
-        /** 
-         * Could be a problem, I just hate looping through strings
-         * more than I have to ;-)
-         */
-        if (pos)
-            errstr = erealloc(errstr, len);
-        else
-            errstr = emalloc(len+1);
-        
-        sprintf(errstr + pos, "%s: %s\n", errors->key, errors->value);
-        
-        pos = len;
+       if (strcmp(errors->key, "msg") == 0) {
+               errstr = estrdup(errors->value);
+               break;
+       }
+
         errors = errors->next;
     }
     
@@ -1427,6 +1416,8 @@
             php_error(E_WARNING, errstr);
             break;
     }
+    
+    efree(errstr);
 }
 
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to