summaryrefslogtreecommitdiff
path: root/user/gnu-ghostscript/do-not-use-sprintf.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-23 20:57:14 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-23 20:57:14 +0000
commit1fc6e8628c639192e744ece0ff1297c6e891d59c (patch)
tree505036966dc22cf5df835bac79e45ac450b7b72e /user/gnu-ghostscript/do-not-use-sprintf.patch
parentb95cbf5cd45243cdca698c50308201241b736b72 (diff)
downloadpackages-1fc6e8628c639192e744ece0ff1297c6e891d59c.tar.gz
packages-1fc6e8628c639192e744ece0ff1297c6e891d59c.tar.bz2
packages-1fc6e8628c639192e744ece0ff1297c6e891d59c.tar.xz
packages-1fc6e8628c639192e744ece0ff1297c6e891d59c.zip
user/gnu-ghostscript: fix build on aarch64
Diffstat (limited to 'user/gnu-ghostscript/do-not-use-sprintf.patch')
-rw-r--r--user/gnu-ghostscript/do-not-use-sprintf.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/user/gnu-ghostscript/do-not-use-sprintf.patch b/user/gnu-ghostscript/do-not-use-sprintf.patch
index 7bf03cd89..e0e84b4fe 100644
--- a/user/gnu-ghostscript/do-not-use-sprintf.patch
+++ b/user/gnu-ghostscript/do-not-use-sprintf.patch
@@ -18,3 +18,68 @@
wl(linebuf);
}
mergefile(os_prefix, inname, in, config, false);
+--- gnu-ghostscript-9.14.1/cups/gdevcups.c.old 2014-07-02 15:13:25.000000000 +0000
++++ gnu-ghostscript-9.14.1/cups/gdevcups.c 2019-01-23 20:56:04.082290416 +0000
+@@ -1039,7 +1039,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);
+@@ -1047,7 +1047,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);
+@@ -1055,7 +1055,7 @@
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsString%d", i);
++ snprintf(name, sizeof(name), "cupsString%d", i);
+ param_string_from_string(s, cups->header.cupsString[i]);
+ if ((code = param_write_string(plist, strdup(name), &s)) < 0)
+ return (code);
+@@ -3166,19 +3166,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))
+ }
+
+@@ -4247,10 +4247,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;