lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r467748 - in /lucene/lucy/trunk/charmonizer/src/Charmonizer/Core: Util.charm Util.harm
Date Wed, 25 Oct 2006 20:06:59 GMT
Author: marvin
Date: Wed Oct 25 13:06:58 2006
New Revision: 467748

URL: http://svn.apache.org/viewvc?view=rev&rev=467748
Log:
Add a missing #include to Util.harm.  Add some missing null-termination to
Util.charm.

Modified:
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.harm

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.charm?view=diff&rev=467748&r1=467747&r2=467748
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.charm Wed Oct 25 13:06:58 2006
@@ -138,6 +138,7 @@
         *buf = realloc(*buf, new_len + 1);
         if (*buf == NULL) 
             die("buffer allocation failed");
+        *((*buf) + new_len) = '\0';
     }
 
     return new_len > old_len ? new_len : old_len;
@@ -160,7 +161,7 @@
 chaz_Util_vappend_strings(char **buf, size_t buf_len, va_list args)
 {
     char *str;
-    size_t new_len = *buf == NULL ? 0 : strlen(*buf);
+    size_t new_len = buf_len == 0 ? 0 : strlen(*buf);
     size_t retval;
     va_list save_args = args;
 
@@ -170,6 +171,8 @@
     }
     new_len += 1; /* terminating null */
     retval = grow_buf(buf, buf_len, new_len);
+    if (buf_len == 0)
+        (*buf)[0] = '\0';
 
     args = save_args;
 

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.harm?view=diff&rev=467748&r1=467747&r2=467748
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.harm Wed Oct 25 13:06:58 2006
@@ -6,6 +6,7 @@
 
 #include <stdio.h>
 #include <stddef.h>
+#include <stdarg.h>
 
 extern int chaz_Util_verbosity;
 



Mime
View raw message