summaryrefslogtreecommitdiff
path: root/print/ghostscript-gpl/patches/patch-ai
blob: f6cd486ffd4ca47991573fc88b41ce8f4a495d5f (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
$NetBSD: patch-ai,v 1.3 2015/08/12 22:20:00 wiz Exp $

chunk 1:
fix build with _FORTIFY_SOURCE=2; it seems the arguments sometimes
overlap.

chunk 2:
replace BSD/Linux specific "qd" printf format specifier by "lld",
should fix build problem on Solaris reported by Joern Clausen
per PR pkg/40664

--- base/mkromfs.c.orig	2012-08-08 08:01:36.000000000 +0000
+++ base/mkromfs.c
@@ -1836,7 +1836,7 @@ ws(const byte *str, int len)
     if (len >= LINE_SIZE)
         exit(1);
 
-    memcpy(linebuf, str, len);
+    memmove(linebuf, str, len);
     flush_line_buf(len);
 }
 
@@ -2178,7 +2178,7 @@ main(int argc, char *argv[])
 #endif
     fprintf(out,"\n#include \"stdint_.h\"\n");
     fprintf(out,"\n#include \"time_.h\"\n\n");
-    fprintf(out,"    time_t gs_romfs_buildtime = %ld;\n\n", time(NULL));
+    fprintf(out,"    time_t gs_romfs_buildtime = %lld;\n\n", (long long)time(NULL));
 
     /* process the remaining arguments (options interspersed with paths) */
     for (; atarg < argc; atarg++) {