summaryrefslogtreecommitdiff
blob: 1592e19b0927929dd6cf0ca4c8b2f3e67caa5d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- ggz-client-libs-0.0.14.1/ggz-config/ggz-config.c.orig	2008-01-05 14:02:46.000000000 -0500
+++ ggz-client-libs-0.0.14.1/ggz-config/ggz-config.c	2008-11-11 15:48:51.000000000 -0500
@@ -452,12 +452,14 @@
 {
 	char *suffix = ".module.dsc";
 	char global_pathname[(moddest ? strlen(destdir) : 0)
-			     + strlen(copydir)
+		+ strlen(copydir) + 2];
+	char full_pathname[strlen(global_pathname)
 			     + strlen(modname)
-			     + strlen(suffix) + 3];
+			     + strlen(suffix) + 2];
 	char fixedmodname[strlen(modname) + 1];
 	unsigned int i;
 
+
 	if(moddest)
 		sprintf(global_pathname, "%s/%s", destdir, copydir);
 	else
@@ -473,10 +475,11 @@
 	for(i = 0; i < strlen(fixedmodname); i++) {
 		if(fixedmodname[i] == '/') fixedmodname[i] = '_';
 	}
-	sprintf(global_pathname, "%s/%s%s", global_pathname, fixedmodname, suffix);
 
-	printf(_("Preserving %s as %s...\n"), modfile, global_pathname);
-	return filecopy(modfile, global_pathname);
+	sprintf(full_pathname, "%s/%s%s", global_pathname, fixedmodname, suffix);
+
+	printf(_("Preserving %s as %s...\n"), modfile, full_pathname);
+	return filecopy(modfile, full_pathname);
 }