[Opensrf-commits] r1072 - in trunk/src: gateway libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Aug 2 23:00:07 EDT 2007


Author: miker
Date: 2007-08-02 22:57:57 -0400 (Thu, 02 Aug 2007)
New Revision: 1072

Modified:
   trunk/src/gateway/osrf_json_gateway.c
   trunk/src/libopensrf/osrf_message.c
Log:
more locale cleanup

Modified: trunk/src/gateway/osrf_json_gateway.c
===================================================================
--- trunk/src/gateway/osrf_json_gateway.c	2007-08-03 02:30:45 UTC (rev 1071)
+++ trunk/src/gateway/osrf_json_gateway.c	2007-08-03 02:57:57 UTC (rev 1072)
@@ -215,7 +215,7 @@
 		if (index(param_locale, ',')) {
 			int ind = index(param_locale, ',') - param_locale;
 			int i;
-			for ( i = 0; i < ind - 1 && i < 128; i++ )
+			for ( i = 0; i < ind && i < 128; i++ )
 				buffer_add_char( osrf_locale_buf, param_locale[i] );
 		} else {
 			buffer_add( osrf_locale_buf, param_locale );

Modified: trunk/src/libopensrf/osrf_message.c
===================================================================
--- trunk/src/libopensrf/osrf_message.c	2007-08-03 02:30:45 UTC (rev 1071)
+++ trunk/src/libopensrf/osrf_message.c	2007-08-03 02:57:57 UTC (rev 1072)
@@ -285,11 +285,12 @@
 			}
 
 			/* use the sender's locale, or the global default */
+			if (current_locale)
+				free( current_locale );
+
 			tmp = jsonObjectGetKey(message, "locale");
 			if(tmp) {
 				new_msg->sender_locale = jsonObjectToSimpleString(tmp);
-				if (current_locale)
-					free( current_locale );
 				current_locale = strdup( new_msg->sender_locale );
 			} else {
 				current_locale = NULL;



More information about the opensrf-commits mailing list