Skip to contentSkip to conversation

cluster/ccs/lib libccs.c

Cluster-devel [email protected] 1 participant 1 message Oct 26, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rmccabe at sourceware.org 2007-10-26 19:18:10

Modified files:
ccs/lib : libccs.c

Log message:
Keep gcc from reporting a bogus warning when compiling with -Wformat=2

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/lib/libccs.c.diff?cvsroot=cluster&r1=1.12&r2=1.13

ccs/lib/libccs.c +4 -4
@@ -702,7 +702,6 @@
 	** Try to match against each clusternode in cluster.conf.
 	*/
 	for (i = 1 ; ; i++) {
-		const char *pathstr = NULL;
 		char canonical_name[128];
 		unsigned int altcnt;
 
@@ -717,7 +716,9 @@
 			char cur_node[128];
 
 			if (altcnt != 0) {
-				ret = snprintf(path, sizeof(path), pathstr, i, altcnt);
+				ret = snprintf(path, sizeof(path), 
+					"/cluster/clusternodes/clusternode[%u]/altname[%u]/@name",
+					i, altcnt);
 				if (ret < 0 || (size_t) ret >= sizeof(path))
 					continue;
 			}
@@ -788,8 +789,7 @@
 
 			free(str);
 
-			/* Try any altnames */
-			pathstr = "/cluster/clusternodes/clusternode[%u]/altname[%u]/@name";
+			/* Now try any altnames */
 		}
 	}