On 08/23/17 20:58, Nigel Taylor wrote:
> Hasn't been updated in a while.
>
> patched for clang
> tests added, by running all examples, requires manual checks of results
> afterwards.
>
> Tried only on amd64.
>
> Ok?
>
>
Missed the attachment again.
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/graphics/dpic/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 23 Oct 2014 13:43:04 -0000 1.5
+++ Makefile 6 Aug 2017 12:47:10 -0000
@@ -2,8 +2,7 @@
COMMENT = pic-like interpreter for producing line graphics
-DISTNAME = dpic-2014.Jan.01
-PKGNAME = ${DISTNAME:S/Jan/01/}
+DISTNAME = dpic-2017.08.01
CATEGORIES = graphics
@@ -13,18 +12,26 @@ HOMEPAGE = https://ece.uwaterloo.ca/~ap
PERMIT_PACKAGE_CDROM = Yes
WANTLIB += c m
-WRKDIST = ${WRKDIR}/dpic
ALL_TARGET = dpic
MASTER_SITES = ${HOMEPAGE}
+
+TEST_DEPENDS = print/texlive/base \
+ print/texlive/texmf,-main
+
+CONFIGURE_STYLE = gnu
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/dpic ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/doc/dpic.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/dpic/
- cd ${WRKSRC}/examples/ && pax -rw * ${PREFIX}/share/examples/dpic/
+ cd ${WRKSRC}/examples/ && \
+ pax -rw sources Examples.txt Makefile README ${PREFIX}/share/examples/dpic/
-NO_TEST = Yes
+do-test:
+ cd ${WRKSRC}/examples/ && \
+ make -e DPIC=${WRKSRC}/dpic all
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/graphics/dpic/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo 23 Oct 2014 13:43:05 -0000 1.4
+++ distinfo 5 Aug 2017 07:00:52 -0000
@@ -1,2 +1,2 @@
-SHA256 (dpic-2014.Jan.01.tar.gz) = Bb5z+hrYrkPonP4cDqkF0RtL5eezWcbn805Rpx6nv8U=
-SIZE (dpic-2014.Jan.01.tar.gz) = 584351
+SHA256 (dpic-2017.08.01.tar.gz) = 0GbWBx4BNqqJpYiiWAuMcFdKg29a7PbOFfRBbV923j0=
+SIZE (dpic-2017.08.01.tar.gz) = 1246842
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile 23 Oct 2014 13:43:05 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.3 2014/10/23 13:43:05 nigel Exp $
-Honour CC and CFLAGS
---- Makefile.orig Mon May 16 13:59:42 2011
-+++ Makefile Sun Mar 17 23:54:29 2013
-@@ -44,8 +44,8 @@ DEST = ${DESTDIR}/${PREFIX}/bin
- # CC=xlc
-
- # other. cc usually works too.
--CFLAGS += $(DEFINEA) $(DEFINEB) $(SAFEMODE) -O
--CC=gcc
-+CFLAGS += $(DEFINEA) $(DEFINEB) $(SAFEMODE)
-+CC?=gcc
- # CC?=gcc
-
- OBJECTS = dpic.o p2clib.o
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_in 23 Jul 2017 16:20:22 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+Index: Makefile.in
+--- Makefile.in.orig
++++ Makefile.in
+@@ -1,10 +1,9 @@
+ # For Linux (expects "make DESTDIR=xxx PREFIX=yyy install"):
+ DESTDIR = /usr
+-PREFIX = .
+-DEST = ${DESTDIR}/${PREFIX}/bin
++DEST = ${PREFIX}/bin
+
+-MANDIR = $(DESTDIR)/$(PREFIX)/share/man/man1
+-DOCDIR = $(DESTDIR)/$(PREFIX)/share/doc/dpic
++MANDIR = $(PREFIX)/share/man/man1
++DOCDIR = $(PREFIX)/share/doc/dpic
+
+ #-----------------------------------------------------------------------
+
+@@ -47,7 +46,7 @@ installdocs: doc/dpicdoc.pdf
+ install -m 644 doc/dpicdoc.pdf $(DOCDIR)
+ install -m 644 doc/dpictools.pic $(DOCDIR)
+ # install -m 644 doc/dpic.1 $(SPECMANDIR)
+- cat doc/dpic.1 | gzip > $(MANDIR)/dpic.1.gz
++ install -m 644 doc/dpic.1 $(MANDIR)
+ #Ubuntu files:
+ #/usr/bin/dpic
+ #/usr/share/doc/dpic/CHANGES.gz
Index: patches/patch-dpic_c
===================================================================
RCS file: patches/patch-dpic_c
diff -N patches/patch-dpic_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-dpic_c 5 Aug 2017 07:03:05 -0000
@@ -0,0 +1,244 @@
+$OpenBSD$
+Index: dpic.c
+--- dpic.c.orig
++++ dpic.c
+@@ -1241,11 +1241,11 @@ void wfloat(FILE **iou, double y)
+ { char buf[25];
+ int i;
+ if (fabs(y)==distmax)
+- sprintf(buf,"%24.6e", y);
++ snprintf(buf,sizeof(buf), "%24.6e", y);
+ else if (y >= 0.0)
+- sprintf(buf,"%24.6f", floor( 1000000*y+0.5)/1000000.0 );
++ snprintf(buf,sizeof(buf), "%24.6f", floor( 1000000*y+0.5)/1000000.0 );
+ else
+- sprintf(buf,"%24.6f",-floor(-1000000*y+0.5)/1000000.0 );
++ snprintf(buf,sizeof(buf), "%24.6f",-floor(-1000000*y+0.5)/1000000.0 );
+ for (i=23; buf[i]=='0'; ) i-- ;
+ if (buf[i]=='.') buf[i] = (char)0;
+ else buf[i+1] = (char)0;
+@@ -1897,7 +1897,7 @@ boolean drawn(primitive *node, int linesp, double fill
+ return true;
+ }
+ else if (linesp == XLdotted || linesp == XLdashed || linesp == XLsolid ||
+- fill >= 0.0 && fill <= 1.0) {
++ (fill >= 0.0 && fill <= 1.0)) {
+ return true;
+ }
+ else {
+@@ -4793,7 +4793,7 @@ void mfpdraw(primitive *node)
+ initnesw();
+ nesw(node);
+ if (node->ptype == XLbox) {
+- if (node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0 ||
++ if ((node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0) ||
+ node->shadedp != NULL) {
+ mfpsetshade(node->Upr.Ubox.boxfill, node->shadedp);
+ mfpbox(node->aat.xpos, node->aat.ypos, north, south, east, west,
+@@ -4812,7 +4812,7 @@ void mfpdraw(primitive *node)
+ break;
+
+ case XLellipse:
+- if (node->Upr.Uellipse.efill >= 0.0 && node->Upr.Uellipse.efill <= 1.0 ||
++ if ((node->Upr.Uellipse.efill >= 0.0 && node->Upr.Uellipse.efill <= 1.0) ||
+ node->shadedp != NULL) {
+ mfpsetshade(node->Upr.Uellipse.efill, node->shadedp);
+ mfpellipse(node->aat, node->Upr.Uellipse.elwidth, node->Upr.Uellipse.elheight);
+@@ -4828,7 +4828,7 @@ void mfpdraw(primitive *node)
+ break;
+
+ case XLcircle:
+- if (node->Upr.Ucircle.cfill >= 0.0 && node->Upr.Ucircle.cfill <= 1.0 ||
++ if ((node->Upr.Ucircle.cfill >= 0.0 && node->Upr.Ucircle.cfill <= 1.0) ||
+ node->shadedp != NULL) {
+ mfpsetshade(node->Upr.Ucircle.cfill, node->shadedp);
+ mfpcircle(node->aat, node->Upr.Ucircle.radius);
+@@ -5423,7 +5423,7 @@ void mpodraw(primitive *node)
+ case XBLOCK:
+ if (node->ptype == XLbox) {
+ if (node->shadedp != NULL ||
+- node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0) {
++ (node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0)) {
+ mpobox("fill ", node->aat, node->Upr.Ubox.boxwidth / 2,
+ node->Upr.Ubox.boxheight / 2, node->Upr.Ubox.boxradius);
+ addcolor(node->shadedp, node->Upr.Ubox.boxfill);
+@@ -5442,7 +5442,7 @@ void mpodraw(primitive *node)
+
+ case XLellipse:
+ if (node->shadedp != NULL ||
+- node->Upr.Uellipse.efill >= 0.0 && node->Upr.Uellipse.efill <= 1.0) {
++ (node->Upr.Uellipse.efill >= 0.0 && node->Upr.Uellipse.efill <= 1.0)) {
+ mpoellipse("fill ", node->aat, node->Upr.Uellipse.elwidth / 2,
+ node->Upr.Uellipse.elheight / 2);
+ addcolor(node->shadedp, node->Upr.Uellipse.efill);
+@@ -5460,7 +5460,7 @@ void mpodraw(primitive *node)
+
+ case XLcircle:
+ if (node->shadedp != NULL ||
+- node->Upr.Ucircle.cfill >= 0.0 && node->Upr.Ucircle.cfill <= 1.0) {
++ (node->Upr.Ucircle.cfill >= 0.0 && node->Upr.Ucircle.cfill <= 1.0)) {
+ printf("fill fullcircle scaled ");
+ wfloat(&output, node->Upr.Ucircle.radius * 2 / fsc);
+ printf(" shifted ");
+@@ -6974,7 +6974,7 @@ void psdraw(primitive *node)
+ switch (node->ptype) {
+
+ case XLbox:
+- if (node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0 ||
++ if ((node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0) ||
+ node->shadedp != NULL) {
+ psbox(node->aat, node->Upr.Ubox.boxwidth / 2,
+ node->Upr.Ubox.boxheight / 2, node->Upr.Ubox.boxradius);
+@@ -7027,7 +7027,7 @@ void psdraw(primitive *node)
+ else {
+ fill = node->Upr.Ucircle.cfill;
+ }
+- if (fill >= 0.0 && fill <= 1.0 || node->shadedp != NULL) {
++ if ((fill >= 0.0 && fill <= 1.0) || node->shadedp != NULL) {
+ pssetthick(lth);
+ printf(" gsave ");
+ pswpos(node->aat);
+@@ -7416,7 +7416,7 @@ void pdfwfloat(double y)
+ ix = ixd;
+ } while (ix != 0 || j <= 6);
+ for (j = 1; j <= ln; j++) {
+- sprintf(STR1, "%c", ts[ln - j]);
++ snprintf(STR1, sizeof(STR1), "%c", ts[ln - j]);
+ pdfstream(STR1, 1, &cx);
+ }
+ }
+@@ -7580,10 +7580,10 @@ void pdfwstring(nametype *p)
+ iswhite = (c == etxch || c == nlch || c == tabch || c == ' ');
+ if (!iswhite || !waswhite) {
+ if (c == bslch || c == ')' || c == '(') {
+- sprintf(STR1, "%c", bslch);
++ snprintf(STR1, sizeof(STR1), "%c", bslch);
+ pdfstream(STR1, 1, &cx);
+ }
+- sprintf(STR1, "%c", c);
++ snprintf(STR1, sizeof(STR1), "%c", c);
+ pdfstream(STR1, 1, &cx);
+ }
+ waswhite = iswhite;
+@@ -8020,7 +8020,7 @@ void pdfdraw(primitive *node)
+
+ case XLbox:
+ if (drawn(node, lsp, node->Upr.Ubox.boxfill)) {
+- fll = (node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0 ||
++ fll = ((node->Upr.Ubox.boxfill >= 0.0 && node->Upr.Ubox.boxfill <= 1.0) ||
+ node->shadedp != NULL);
+ pdflinearfill(node->Upr.Ubox.boxfill, node->shadedp);
+ pdflineopts(lsp, node->lparam, lth, node->outlinep);
+@@ -8052,7 +8052,7 @@ void pdfdraw(primitive *node)
+ fill = node->Upr.Ucircle.cfill;
+ }
+ if (drawn(node, lsp, fill)) {
+- fll = (fill >= 0.0 && fill <= 1.0 || node->shadedp != NULL);
++ fll = ((fill >= 0.0 && fill <= 1.0) || node->shadedp != NULL);
+ pdflinearfill(fill, node->shadedp);
+ pdflineopts(lsp, node->lparam, lth, node->outlinep);
+ pdfellipse(node->aat, x, y);
+@@ -8160,7 +8160,7 @@ void pdfdraw(primitive *node)
+ pdfwpos(node->Upr.Uline.endpos);
+ pdfstream(" l", 2, &cx);
+ if (node->son != NULL) {
+- sprintf(STR1, "%c", nlch);
++ snprintf(STR1, sizeof(STR1), "%c", nlch);
+ pdfstream(STR1, 1, &cx);
+ }
+ else {
+@@ -8241,7 +8241,7 @@ void pdfdraw(primitive *node)
+ case XLaTeX:
+ if (node->textp != NULL) {
+ pdfwstring(node->textp);
+- sprintf(STR1, "%c", nlch);
++ snprintf(STR1, sizeof(STR1), "%c", nlch);
+ pdfstream(STR1, 1, &cx);
+ }
+ break;
+@@ -8448,7 +8448,7 @@ void texdraw(primitive *node)
+ lgth = linlen(node->Upr.Uline.endpos.xpos - node->aat.xpos,
+ node->Upr.Uline.endpos.ypos - node->aat.ypos);
+ if (drawmode == Pict2e ||
+- lsp == XLsolid && (lgth > 0.18 || drawmode == tTeX)) {
++ (lsp == XLsolid && (lgth > 0.18 || drawmode == tTeX))) {
+ if (lgth > 0) {
+ printf("\\put");
+ wpos(node->aat);
+@@ -8759,16 +8759,16 @@ void texdraw(primitive *node)
+ node->direction = p->direction;
+ }
+ }
+- if (node->direction == XLleft && node->Upr.Uline.endpos.ypos < 0.0 ||
+- node->direction == XLdown && node->Upr.Uline.endpos.ypos > 0.0) {
++ if ((node->direction == XLleft && node->Upr.Uline.endpos.ypos < 0.0) ||
++ (node->direction == XLdown && node->Upr.Uline.endpos.ypos > 0.0)) {
+ printf("[bl]}\n");
+ }
+- else if (node->direction == XLleft && node->Upr.Uline.endpos.ypos > 0.0 ||
+- node->direction == XLup && node->Upr.Uline.endpos.ypos < 0.0) {
++ else if ((node->direction == XLleft && node->Upr.Uline.endpos.ypos > 0.0) ||
++ (node->direction == XLup && node->Upr.Uline.endpos.ypos < 0.0)) {
+ printf("[tl]}\n");
+ }
+- else if (node->direction == XLright && node->Upr.Uline.endpos.ypos < 0.0 ||
+- node->direction == XLup && node->Upr.Uline.endpos.ypos > 0.0) {
++ else if ((node->direction == XLright && node->Upr.Uline.endpos.ypos < 0.0) ||
++ (node->direction == XLup && node->Upr.Uline.endpos.ypos > 0.0)) {
+ printf("[tr]}\n");
+ }
+ else {
+@@ -12552,8 +12552,8 @@ void produce(stackinx newp, int p)
+ }
+ else {
+ With1->xval += With1->yval;
+- if (With1->yval > 0 && With1->xval > With1->endchop ||
+- With1->yval < 0 && With1->xval < With1->endchop) {
++ if ((With1->yval > 0 && With1->xval > With1->endchop) ||
++ (With1->yval < 0 && With1->xval < With1->endchop)) {
+ bswitch = true;
+ }
+ }
+@@ -13464,16 +13464,16 @@ void produce(stackinx newp, int p)
+ s = sin(With2->Upr.Uline.endpos.xpos);
+ With2->aat.xpos += With2->Upr.Uline.aradius * r;
+ With2->aat.ypos += With2->Upr.Uline.aradius * s;
+- if (With2->direction == XLup && i == XLleft ||
+- With2->direction == XLdown && i == XLright ||
+- With2->direction == XLright && i == XLup ||
+- With2->direction == XLleft && i == XLdown) {
++ if ((With2->direction == XLup && i == XLleft) ||
++ (With2->direction == XLdown && i == XLright) ||
++ (With2->direction == XLright && i == XLup) ||
++ (With2->direction == XLleft && i == XLdown)) {
+ With2->Upr.Uline.endpos.ypos = pi * 0.5;
+ }
+- else if (With2->direction == XLup && i == XLright ||
+- With2->direction == XLdown && i == XLleft ||
+- With2->direction == XLright && i == XLdown ||
+- With2->direction == XLleft && i == XLup) {
++ else if ((With2->direction == XLup && i == XLright) ||
++ (With2->direction == XLdown && i == XLleft) ||
++ (With2->direction == XLright && i == XLdown) ||
++ (With2->direction == XLleft && i == XLup)) {
+ With2->Upr.Uline.endpos.ypos = -pi * 0.5;
+ }
+ if (attstack[newp+2].lexval != XEMPTY) {
+@@ -17640,7 +17640,7 @@ void defineargbody(int *parenlevel, fbuffer **p2)
+ }
+ }
+ /*D if debuglevel=2 then write(log,' instring=',instring,' '); D*/
+- if (!instring && (*parenlevel < 0 || *parenlevel == 0 && ch == ',')) {
++ if (!instring && (*parenlevel < 0 || (*parenlevel == 0 && ch == ','))) {
+ j = With->savedlen;
+ inarg = false;
+ }
+@@ -18743,7 +18743,7 @@ void getoptions(void)
+ } /* getoptions */
+
+
+-void main(int argc, Char *argv[])
++int main(int argc, Char *argv[])
+ { P_argc = argc; P_argv = argv; __top_jb = NULL;
+ redirect = NULL;
+ copyin = NULL;
Index: patches/patch-p2c_h
===================================================================
RCS file: patches/patch-p2c_h
diff -N patches/patch-p2c_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-p2c_h 23 Jul 2017 16:20:22 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+Index: p2c.h
+--- p2c.h.orig
++++ p2c.h
+@@ -435,12 +435,7 @@ typedef struct {
+ } _TEXT;
+
+ /* Memory allocation */
+-#ifdef __GCC__
+-# define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem())
+-#else
+-extern Anyptr __MallocTemp__;
+-# define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem())
+-#endif
++extern void *Malloc(size_t);
+ #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */
+ #define Free(p) (free((Anyptr)(p)), (p)=NULL)
+
Index: patches/patch-p2clib_c
===================================================================
RCS file: patches/patch-p2clib_c
diff -N patches/patch-p2clib_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-p2clib_c 23 Jul 2017 17:13:03 -0000
@@ -0,0 +1,208 @@
+$OpenBSD$
+Index: p2clib.c
+--- p2clib.c.orig
++++ p2clib.c
+@@ -30,8 +30,6 @@ int P_ioresult;
+
+ long EXCP_LINE; /* Used by Pascal workstation system */
+
+-Anyptr __MallocTemp__;
+-
+ __p2c_jmp_buf *__top_jb;
+
+
+@@ -417,9 +415,10 @@ register int pos, len;
+
+ /* Insert string "src" at index "pos" of "dst". */
+
+-void strinsert(src, dst, pos)
++void strinsert(src, dst, pos, size)
+ register char *src, *dst;
+ register int pos;
++size_t size;
+ {
+ register int slen, dlen;
+
+@@ -429,7 +428,7 @@ register int pos;
+ dst += dlen;
+ dlen -= pos;
+ if (dlen <= 0) {
+- strcpy(dst, src);
++ strlcpy(dst, src, size);
+ return;
+ }
+ slen = strlen(src);
+@@ -890,7 +889,7 @@ int *Day, *Month, *Year, *Hour, *Min, *Sec;
+ {
+ #ifndef NO_TIME
+ struct tm *tm;
+- long clock;
++ time_t clock;
+
+ time(&clock);
+ tm = localtime(&clock);
+@@ -908,7 +907,7 @@ int *Day, *Month, *Year, *Hour, *Min, *Sec;
+ Void VAXdate(s)
+ char *s;
+ {
+- long clock;
++ time_t clock;
+ char *c;
+ int i;
+ static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23};
+@@ -924,7 +923,7 @@ char *s;
+ Void VAXtime(s)
+ char *s;
+ {
+- long clock;
++ time_t clock;
+ char *c;
+ int i;
+
+@@ -959,7 +958,14 @@ register int len, n;
+ }
+
+
++void *Malloc(size_t size) {
++ void *p;
+
++ if ( (p = malloc(size)) )
++ return p;
++ _OutMem();
++ return p;
++}
+
+ /* if defined(__GNUC__) || defined(HAVE_INTTYPES_H) */
+ #ifndef NO_INTTYPES_H
+@@ -985,85 +991,87 @@ int _NilCheck()
+ /* The following is suitable for the HP Pascal operating system.
+ It might want to be revised when emulating another system. */
+
+-char *_ShowEscape(buf, code, ior, prefix)
++char *_ShowEscape(buf, code, ior, prefix, size)
+ char *buf, *prefix;
+-int code, ior;
++int code, ior, size;
+ {
+ char *bufp;
++ int sizep;
+
+ if (prefix && *prefix) {
+- strcpy(buf, prefix);
+- strcat(buf, ": ");
++ strlcpy(buf, prefix, size);
++ strlcat(buf, ": ", size);
+ bufp = buf + strlen(buf);
+ } else {
+ bufp = buf;
+ }
++ sizep = size - strlen(buf);
+ if (code == -10) {
+- sprintf(bufp, "Pascal system I/O error %d", ior);
++ snprintf(bufp, sizep, "Pascal system I/O error %d", ior);
+ switch (ior) {
+ case 3:
+- strcat(buf, " (illegal I/O request)");
++ strlcat(buf, " (illegal I/O request)", size);
+ break;
+ case 7:
+- strcat(buf, " (bad file name)");
++ strlcat(buf, " (bad file name)", size);
+ break;
+ case FileNotFound: /*10*/
+- strcat(buf, " (file not found)");
++ strlcat(buf, " (file not found)", size);
+ break;
+ case FileNotOpen: /*13*/
+- strcat(buf, " (file not open)");
++ strlcat(buf, " (file not open)", size);
+ break;
+ case BadInputFormat: /*14*/
+- strcat(buf, " (bad input format)");
++ strlcat(buf, " (bad input format)", size);
+ break;
+ case 24:
+- strcat(buf, " (not open for reading)");
++ strlcat(buf, " (not open for reading)", size);
+ break;
+ case 25:
+- strcat(buf, " (not open for writing)");
++ strlcat(buf, " (not open for writing)", size);
+ break;
+ case 26:
+- strcat(buf, " (not open for direct access)");
++ strlcat(buf, " (not open for direct access)", size);
+ break;
+ case 28:
+- strcat(buf, " (string subscript out of range)");
++ strlcat(buf, " (string subscript out of range)", size);
+ break;
+ case EndOfFile: /*30*/
+- strcat(buf, " (end-of-file)");
++ strlcat(buf, " (end-of-file)", size);
+ break;
+ case FileWriteError: /*38*/
+- strcat(buf, " (file write error)");
++ strlcat(buf, " (file write error)", size);
+ break;
+ }
+ } else {
+- sprintf(bufp, "Pascal system error %d", code);
++ snprintf(bufp, sizep, "Pascal system error %d", code);
+ switch (code) {
+ case -2:
+- strcat(buf, " (out of memory)");
++ strlcat(buf, " (out of memory)", size);
+ break;
+ case -3:
+- strcat(buf, " (reference to NIL pointer)");
++ strlcat(buf, " (reference to NIL pointer)", size);
+ break;
+ case -4:
+- strcat(buf, " (integer overflow)");
++ strlcat(buf, " (integer overflow)", size);
+ break;
+ case -5:
+- strcat(buf, " (divide by zero)");
++ strlcat(buf, " (divide by zero)", size);
+ break;
+ case -6:
+- strcat(buf, " (real math overflow)");
++ strlcat(buf, " (real math overflow)", size);
+ break;
+ case -8:
+- strcat(buf, " (value range error)");
++ strlcat(buf, " (value range error)", size);
+ break;
+ case -9:
+- strcat(buf, " (CASE value range error)");
++ strlcat(buf, " (CASE value range error)", size);
+ break;
+ case -12:
+- strcat(buf, " (bus error)");
++ strlcat(buf, " (bus error)", size);
+ break;
+ case -20:
+- strcat(buf, " (stopped by user)");
++ strlcat(buf, " (stopped by user)", size);
+ break;
+ }
+ }
+@@ -1086,7 +1094,7 @@ int code;
+ exit(EXIT_SUCCESS);
+ if (code == -1)
+ exit(EXIT_FAILURE);
+- fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, ""));
++ fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "", sizeof(buf)));
+ exit(EXIT_FAILURE);
+ }
+
+@@ -1105,7 +1113,7 @@ char *name;
+ if (!__top_jb && name && *name) {
+ char buf[100];
+ fprintf(stderr, "%s: %s\n",
+- name, _ShowEscape(buf, P_escapecode, P_ioresult, ""));
++ name, _ShowEscape(buf, P_escapecode, P_ioresult, "", sizeof(buf)));
+ exit(EXIT_FAILURE);
+ }
+ return _Escape(-10);
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/graphics/dpic/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 15 May 2011 18:49:41 -0000 1.1.1.1
+++ pkg/PLIST 3 Aug 2016 11:49:51 -0000
@@ -6,6 +6,10 @@ share/examples/dpic/Examples.txt
share/examples/dpic/Makefile
share/examples/dpic/README
share/examples/dpic/sources/
+share/examples/dpic/sources/arcs.pic
+share/examples/dpic/sources/arrowheads.pic
+share/examples/dpic/sources/arrows.pic
+share/examples/dpic/sources/basictests.pic
share/examples/dpic/sources/diag1.pic
share/examples/dpic/sources/diag2.pic
share/examples/dpic/sources/diag3.pic
@@ -15,6 +19,46 @@ share/examples/dpic/sources/diag8.pic
share/examples/dpic/sources/diag9.pic
share/examples/dpic/sources/diagA.pic
share/examples/dpic/sources/diagB.pic
+share/examples/dpic/sources/diagC.pic
+share/examples/dpic/sources/man.tex
+share/examples/dpic/sources/man01.pic
+share/examples/dpic/sources/man02.pic
+share/examples/dpic/sources/man03.pic
+share/examples/dpic/sources/man04.pic
+share/examples/dpic/sources/man05.pic
+share/examples/dpic/sources/man06.pic
+share/examples/dpic/sources/man07.pic
+share/examples/dpic/sources/man08.pic
+share/examples/dpic/sources/man09.pic
+share/examples/dpic/sources/man10.pic
+share/examples/dpic/sources/man11.pic
+share/examples/dpic/sources/man12.pic
+share/examples/dpic/sources/man13.pic
+share/examples/dpic/sources/man14.pic
+share/examples/dpic/sources/man15.pic
+share/examples/dpic/sources/man16.pic
+share/examples/dpic/sources/man17.pic
+share/examples/dpic/sources/man18.pic
+share/examples/dpic/sources/man19.pic
+share/examples/dpic/sources/man20.pic
+share/examples/dpic/sources/man21.pic
+share/examples/dpic/sources/man22.pic
+share/examples/dpic/sources/man24.pic
+share/examples/dpic/sources/man25.pic
+share/examples/dpic/sources/man26.pic
+share/examples/dpic/sources/man28.pic
+share/examples/dpic/sources/man29.pic
+share/examples/dpic/sources/man30.pic
+share/examples/dpic/sources/man31.pic
+share/examples/dpic/sources/man32.pic
+share/examples/dpic/sources/man33.pic
+share/examples/dpic/sources/man34.pic
+share/examples/dpic/sources/man35.pic
+share/examples/dpic/sources/man36.pic
+share/examples/dpic/sources/man45.pic
+share/examples/dpic/sources/man46.pic
+share/examples/dpic/sources/man47.pic
+share/examples/dpic/sources/mode.tex
share/examples/dpic/sources/test1.tex
share/examples/dpic/sources/test2.tex
share/examples/dpic/sources/test3.tex