[Opensrf-commits] r1780 - trunk/src/gateway (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Sep 12 14:19:39 EDT 2009


Author: scottmk
Date: 2009-09-12 14:19:35 -0400 (Sat, 12 Sep 2009)
New Revision: 1780

Modified:
   trunk/src/gateway/apachetools.c
Log:
In apacheGetParamValues() and apacheGetFirstParamValue():
applied const qualifier to nkey.

Also: changed the ensuing NULL tests to look at nkey
instead of key, since key has already been verified as
non-NULL.

Actually it looks like nkey is guaranteed to be non-NULL
as well, but that depends on the correct functioning
of osrfStringArray; so I left the NULL test, as
revised, in place.


Modified: trunk/src/gateway/apachetools.c
===================================================================
--- trunk/src/gateway/apachetools.c	2009-09-12 17:59:39 UTC (rev 1779)
+++ trunk/src/gateway/apachetools.c	2009-09-12 18:19:35 UTC (rev 1780)
@@ -132,8 +132,8 @@
 	osrfLogDebug(OSRF_LOG_MARK, "Fetching URL values for key %s", key);
 	int i;
 	for( i = 0; i < params->size; i++ ) {
-		char* nkey = osrfStringArrayGetString(params, i++);
-		if(key && !strcmp(nkey, key)) 
+		const char* nkey = osrfStringArrayGetString(params, i++);
+		if(nkey && !strcmp(nkey, key)) 
 			osrfStringArrayAdd(sarray, osrfStringArrayGetString(params, i));
 	}
 	return sarray;
@@ -146,8 +146,8 @@
 	int i;
 	osrfLogDebug(OSRF_LOG_MARK, "Fetching first URL value for key %s", key);
 	for( i = 0; i < params->size; i++ ) {
-		char* nkey = osrfStringArrayGetString(params, i++);
-		if(key && !strcmp(nkey, key)) 
+		const char* nkey = osrfStringArrayGetString(params, i++);
+		if(nkey && !strcmp(nkey, key)) 
 			return strdup(osrfStringArrayGetString(params, i));
 	}
 



More information about the opensrf-commits mailing list