[Opensrf-commits] r1495 - branches/rel_1_0/include/opensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Nov 16 21:58:34 EST 2008


Author: erickson
Date: 2008-11-16 21:58:32 -0500 (Sun, 16 Nov 2008)
New Revision: 1495

Modified:
   branches/rel_1_0/include/opensrf/utils.h
Log:
backporting 1494, osrf_buffer_add_char patch to append nul byte

Modified: branches/rel_1_0/include/opensrf/utils.h
===================================================================
--- branches/rel_1_0/include/opensrf/utils.h	2008-11-17 02:56:40 UTC (rev 1494)
+++ branches/rel_1_0/include/opensrf/utils.h	2008-11-17 02:58:32 UTC (rev 1495)
@@ -69,8 +69,10 @@
 #define OSRF_BUFFER_ADD_CHAR(gb, c)\
 	do {\
 		if(gb) {\
-			if(gb->n_used < gb->size - 1)\
+			if(gb->n_used < gb->size - 1) {\
 				gb->buf[gb->n_used++] = c;\
+				gb->buf[gb->n_used]   = '\0';\
+			}\
 			else\
 				buffer_add_char(gb, c);\
 		}\
@@ -207,7 +209,7 @@
 char* va_list_to_string(const char* format, ...);
 
 
-/* string escape utility method.  escapes unicode embeded characters.
+/* string escape utility method.  escapes unicode embedded characters.
 	escapes the usual \n, \t, etc. 
 	for example, if you provide a string like so:
 



More information about the opensrf-commits mailing list