f004b82
diff -up open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c.crash open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c
f004b82
--- open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c.crash	2008-11-22 18:06:46.000000000 +0100
f004b82
+++ open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c	2009-04-27 20:33:33.000000000 +0200
f004b82
@@ -341,6 +341,7 @@ static int loop_devs(const char *devtree
f004b82
 	int i;
f004b82
 	char prefix[256];
f004b82
 
f004b82
+	nic_count = 0;
f004b82
 	error = nftw(devtree, find_nics, 20, 0);
f004b82
 	if (error)
f004b82
 		return error;
f004b82
@@ -352,6 +353,7 @@ static int loop_devs(const char *devtree
f004b82
 	qsort(niclist, nic_count, sizeof(char *), nic_cmp);
f004b82
 
f004b82
 	snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
f004b82
+	dev_count = 0;
f004b82
 	error = nftw(prefix, find_initiator, 20, 0);
f004b82
 	if (error)
f004b82
 		return error;
f004b82
@@ -366,8 +368,6 @@ static int loop_devs(const char *devtree
f004b82
 
f004b82
 		}
f004b82
 	}
f004b82
-	if (!error)
f004b82
-		putchar('\n');
f004b82
 	return error;
f004b82
 }
f004b82
 
f004b82
@@ -425,7 +425,7 @@ static void fill_context(struct boot_con
f004b82
 int fwparam_ppc(struct boot_context *context, const char *filepath)
f004b82
 {
f004b82
 	int error;
f004b82
-	int fplen = 0;
f004b82
+	int dev_count;
f004b82
 	char *devtree;
f004b82
 
f004b82
 	/*
f004b82
@@ -435,13 +435,10 @@ int fwparam_ppc(struct boot_context *con
f004b82
 	 * systems that can support iscsi are the ones that provide
f004b82
 	 * the appropriate FCODE with a load method.
f004b82
 	 */
f004b82
-	if (filepath) {
f004b82
-		strncat(filename, filepath, FILENAMESZ);
f004b82
-		fplen = strlen(filename);
f004b82
-	} else
f004b82
-		strncat(filename, DT_TOP, FILENAMESZ);
f004b82
-
f004b82
-	strncat(filename + fplen, BOOTPATH, FILENAMESZ - fplen);
f004b82
+	if (filepath)  
f004b82
+		snprintf(filename, FILENAMESZ, "%s%s", filepath, BOOTPATH);
f004b82
+	else
f004b82
+		snprintf(filename, FILENAMESZ, "%s%s", DT_TOP, BOOTPATH);
f004b82
 
f004b82
 	if (debug)
f004b82
 		fprintf(stderr, "%s: file:%s; debug:%d\n", __func__, filename,