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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
--- a/bigbang.c 2015-10-27 09:21:51.172611109 +0100
+++ b/bigbang.c 2015-10-27 09:25:41.117233447 +0100
@@ -530,13 +530,11 @@
planetfile = fopen ("./planets.data", "w");
for (loop = 1; loop <= 299 - strlen(terraInfo); loop++)
strcat(terraInfo, " ");
- strcat(terraInfo, "\n");
- fprintf (planetfile, terraInfo);
+ fprintf (planetfile, "%s\n", terraInfo);
sprintf (ferrinfo, "%d:%d:Ferringhi:1:-2:Unknown:1000:1000:1000:0:0:0:0:3:100000:20:30:10:0:0:0:0:", 2, ferringhiSector);
for (loop = 1; loop <= 299 - strlen(ferrinfo); loop++)
strcat(ferrinfo, " ");
- strcat(ferrinfo, "\n");
- fprintf(planetfile, ferrinfo);
+ fprintf(planetfile, "%s\n", ferrinfo);
randomPlanetInfo = malloc (sizeof (strNameLength));
if (numRandomPlanets > 0)
{
@@ -552,8 +550,7 @@
, c, tempint, randomname (randomPlanetInfo), randomnum(1,5));
for (loop = 1; loop <= 299 - strlen(ferrinfo); loop++)
strcat(ferrinfo, " ");
- strcat(ferrinfo, "\n");
- fprintf(planetfile, ferrinfo);
+ fprintf(planetfile, "%s\n", ferrinfo);
c++;
}
@@ -616,10 +613,9 @@
fileline = strcat (fileline, ":");
if (sectorlist[x]->nebulae != NULL)
fileline = strcat (fileline, sectorlist[x]->nebulae);
- fileline = strcat (fileline, ":\n");
/* Later put in whitespace buffer for saving */
/* Not needed until user created beacons put in */
- fprintf (file, fileline);
+ fprintf (file, "%s:\n", fileline);
}
fclose (file);
free (fileline);
@@ -646,8 +642,7 @@
len = (int) strlen (fileline);
for (y = 0; y <= 99 - len; y++)
strcat (fileline, " ");
- strcat (fileline, "\n");
- fprintf (file, fileline);
+ fprintf (file, "%s\n", fileline);
}
fclose (file);
--- a/config.c 2015-10-27 09:30:00.091283678 +0100
+++ b/config.c 2015-10-27 09:30:25.068806593 +0100
@@ -140,9 +140,8 @@
for (loop=0; loop < 199 - strlen(buffer); loop++)
strcat(buffer, " ");
- strcat(buffer, "\n");
- fprintf(configfile, buffer);
+ fprintf(configfile, "%s\n", buffer);
fclose(configfile);
free(buffer);
--- a/planet.c 2015-10-27 09:31:44.867282757 +0100
+++ b/planet.c 2015-10-27 09:32:17.083667674 +0100
@@ -59,8 +59,7 @@
addint(stufftosave, planets[index]->citdl->upgradestart, ':', BUFF_SIZE);
for (loop=0; loop< 399 - strlen(stufftosave); loop++)
strcat(stufftosave, " ");
- strcat(stufftosave, "\n");
- fprintf(planetfile, stufftosave);
+ fprintf(planetfile, "%s\n", stufftosave);
}
}
fclose(planetfile);
|