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
|
--- ./cups/gdevcups.c.orig
+++ ./cups/gdevcups.c
@@ -1042,7 +1042,7 @@
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsInteger%d", i);
+ snprintf(name, sizeof(name), "cupsInteger%d", i);
if ((code = param_write_int(plist, strdup(name),
(int *)(cups->header.cupsInteger + i))) < 0)
return (code);
@@ -1050,7 +1050,7 @@
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsReal%d", i);
+ snprintf(name, sizeof(name), "cupsReal%d", i);
if ((code = param_write_float(plist, strdup(name),
cups->header.cupsReal + i)) < 0)
return (code);
@@ -1058,7 +1058,7 @@
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsString%d", i);
+ snprintf(name, sizeof(name), "cupsString%d", i);
param_string_from_transient_string(s, cups->header.cupsString[i]);
if ((code = param_write_string(plist, strdup(name), &s)) < 0)
return (code);
@@ -3184,19 +3184,19 @@
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsInteger%d", i);
+ snprintf(name, sizeof(name), "cupsInteger%d", i);
intoption(cupsInteger[i],strdup(name), unsigned)
}
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsReal%d", i);
+ snprintf(name, sizeof(name), "cupsReal%d", i);
floatoption(cupsReal[i], strdup(name))
}
for (i = 0; i < 16; i ++)
{
- sprintf(name, "cupsString%d", i);
+ snprintf(name, sizeof(name), "cupsString%d", i);
stringoption(cupsString[i], strdup(name))
}
@@ -4271,10 +4271,10 @@
*/
if (pdev->HWResolution[0] != pdev->HWResolution[1])
- sprintf(resolution, "%.0fx%.0fdpi", pdev->HWResolution[0],
+ snprintf(resolution, sizeof(resolution), "%.0fx%.0fdpi", pdev->HWResolution[0],
pdev->HWResolution[1]);
else
- sprintf(resolution, "%.0fdpi", pdev->HWResolution[0]);
+ snprintf(resolution, sizeof(resolution), "%.0fdpi", pdev->HWResolution[0]);
for (i = 0, profile = cups->PPD->profiles;
i < cups->PPD->num_profiles;
|