Hello community,

here is the log from the commit of package potrace for openSUSE:Factory checked 
in at 2017-08-12 20:03:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/potrace (Old)
 and      /work/SRC/openSUSE:Factory/.potrace.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "potrace"

Sat Aug 12 20:03:30 2017 rev:28 rq:515106 version:1.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/potrace/potrace.changes  2017-03-03 
17:33:09.581574986 +0100
+++ /work/SRC/openSUSE:Factory/.potrace.new/potrace.changes     2017-08-12 
20:03:32.666917048 +0200
@@ -1,0 +2,12 @@
+Mon Aug  7 17:28:41 CEST 2017 - sbra...@suse.com
+
+- Update to version 1.15:
+  * Fix potential buffer overflows and arithmetic overflows
+    (bsc#1051634, CVE-2017-12067).
+  * Fix bug triggered by very large bitmaps.
+  * Other bugfixes.
+- Build position independent binaries.
+- Process with spec-cleaner.
+- Work around failure of -fstack-protector on s390x.
+
+-------------------------------------------------------------------

Old:
----
  potrace-1.14.tar.gz

New:
----
  potrace-1.15.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ potrace.spec ++++++
--- /var/tmp/diff_new_pack.E60xCp/_old  2017-08-12 20:03:34.450667173 +0200
+++ /var/tmp/diff_new_pack.E60xCp/_new  2017-08-12 20:03:34.462665493 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           potrace
-Version:        1.14
+Version:        1.15
 Release:        0
 Summary:        Utility for Tracing a Bitmap to Scalable Outline Image
 License:        GPL-2.0+
@@ -25,12 +25,11 @@
 Url:            http://potrace.sourceforge.net/
 Source:         
http://potrace.sourceforge.net/download/%{version}/%{name}-%{version}.tar.gz
 BuildRequires:  zlib-devel
+Provides:       bitmap_tracing
 %ifnarch ppc s390
 # gcc is supported as well, but clang is preferred by the upstream.
 BuildRequires:  clang
 %endif
-Provides:       bitmap_tracing
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
 Potrace is a utility for tracing a bitmap, which means, transforming a
@@ -72,6 +71,14 @@
 %setup -q
 
 %build
+%define warn_flags -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security
+export CFLAGS="%{optflags} %{warn_flags} -fPIE"
+export LDFLAGS="-pie"
+%ifarch s390x
+# clang on s390x does not support -fstack-protector from the default optflags
+# (undefined reference to `__stack_chk_guard')
+export CFLAGS="${CFLAGS/-fstack-protector /}"
+%endif
 %configure\
        --docdir=%{_docdir}/%{name}\
        --with-libpotrace\
@@ -79,33 +86,26 @@
 make  %{?_smp_mflags}
 
 %install
-%if %suse_version > 1110
+%if 0%{?suse_version} > 1110
 %make_install
 %else
-%makeinstall
+%make_install
 %endif
 cp -a AUTHORS ChangeLog COPYING NEWS README %{buildroot}%{_docdir}/%{name}/
 rm %{buildroot}%{_libdir}/*.*a
 
-%clean
-rm -rf %{buildroot}
-
 %post -n libpotrace0 -p /sbin/ldconfig
-
 %postun -n libpotrace0 -p /sbin/ldconfig
 
 %files
-%defattr(-,root,root)
 %{_bindir}/*
 %doc %{_docdir}/%{name}
-%doc %{_mandir}/man?/*.*
+%{_mandir}/man?/*%{ext_man}
 
 %files -n libpotrace0
-%defattr(-,root,root)
 %{_libdir}/*.so.*
 
 %files devel
-%defattr(-,root,root)
 %{_includedir}/*.h
 %{_libdir}/*.so
 

++++++ potrace-1.14.tar.gz -> potrace-1.15.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/ChangeLog new/potrace-1.15/ChangeLog
--- old/potrace-1.14/ChangeLog  2017-02-20 02:18:43.000000000 +0100
+++ new/potrace-1.15/ChangeLog  2017-08-05 16:14:36.000000000 +0200
@@ -1,5 +1,25 @@
 ChangeLog
 
+v1.15 2017/08/05
+       (2017/08/05) PS1 - use round() instead of rint()
+       (2017/08/05) PS1 - portability: set both _POSIX_C_SOURCE and
+       _NETBSD_SOURCE to enable strdup prototype in string.h, as
+       _XOPEN_SOURCE=500 doesn't work on macOS, _XOPEN_SOURCE=600 doesn't
+       work on SunOS, and _POSIX_C_SOURCE alone doesn't work on Minix.
+       (2017/08/02) PS1 - fixed a potential arithmetic overflow.
+       (2017/06/17) PS1 - fixed a bug with very large bitmaps. Reported
+       by Michael Voříšek.
+       (2017/03/05) PS1 - autoconf: added --enable-local-getopt to avoid
+       using the system-wide getopt library (it may still end up being
+       used on GNU systems).
+       (2017/03/05) PS1 - portability: moved getopt.h to a subdirectory,
+       to be included only when needed. Reported by Daniel Macks.
+       (2017/03/05) PS1 - portability: use _XOPEN_SOURCE=600 to fix macOS
+       warning.
+       (2017/02/27) PS1 - fixed more buffer overflows (not security
+       critical), including one reported by Agostino Sarubbo. This also
+       fixes CVE-2017-12067.
+
 v1.14 2017/02/19
        (2017/02/19) PS1 - speed: use clang as default compiler if
        available, and no longer use -ffloat-store even with gcc.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/Makefile.in new/potrace-1.15/Makefile.in
--- old/potrace-1.14/Makefile.in        2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/Makefile.in        2017-08-05 16:12:05.000000000 +0200
@@ -233,6 +233,7 @@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXTRA_INCLUDES = @EXTRA_INCLUDES@
 EXTRA_LIBS = @EXTRA_LIBS@
 EXTRA_OBJS = @EXTRA_OBJS@
 FGREP = @FGREP@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/NEWS new/potrace-1.15/NEWS
--- old/potrace-1.14/NEWS       2017-02-20 03:42:25.000000000 +0100
+++ new/potrace-1.15/NEWS       2017-08-05 16:11:41.000000000 +0200
@@ -1,3 +1,12 @@
+August 5, 2017: Release 1.15
+
+ This release consists of bugfixes and minor portability improvements.
+ Some potential buffer overflows and arithmetic overflows were fixed,
+ including CVE-2017-12067. A bug triggered by very large bitmaps has
+ been fixed. A new configuration option --enable-local-getopt was
+ added. Thanks to Agostino Sarubbo, Daniel Macks, and Michael Voříšek
+ for reporting bugs and suggesting improvements.
+
 February 19, 2017: Release 1.14
 
  This release consists of bugfixes and minor portability improvements.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/README new/potrace-1.15/README
--- old/potrace-1.14/README     2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/README     2017-08-04 21:19:34.000000000 +0200
@@ -7,16 +7,16 @@
 
  Potrace is a tool for tracing a bitmap, which means, transforming a
  bitmap into a smooth, scalable image.  The input is a bitmap (PBM,
- PGM, PPM, or BMP), and the default output is one of several vector
- file formats.  A typical use is to create EPS files from scanned
+ PGM, PPM, or BMP), and the output is one of several vector file
+ formats.  A typical use is to create SVG or PDF files from scanned
  data, such as company or university logos, handwritten notes, etc.
  The resulting image is not "jaggy" like a bitmap, but smooth. It can
  then be rendered at any resolution.
 
- Potrace can currently produce the following output formats: EPS,
- PostScript, PDF, SVG (scalable vector graphics), DXF, GeoJSON, PGM
- (for easy antialiasing of pixel-based images), Gimppath, and
- XFig. Additional backends might be added in the future.
+ Potrace can currently produce the following output formats: SVG, PDF,
+ EPS, PostScript, DXF, GeoJSON, PGM (for easy antialiasing of
+ pixel-based images), Gimppath, and XFig. Additional backends might be
+ added in the future.
 
  A separate program, mkbitmap, is also provided. This program can act
  as a pre-processor for Potrace, applying scaling and various filters
@@ -40,6 +40,7 @@
   --enable-metric         use metric units (centimeters) as default
   --enable-a4             use a4 as the default papersize
   --enable-dumb-tty       use simplified ASCII-only progress bar
+  --enable-local-getopt   avoid using the system-wide getopt library
 
  See also ./configure --help.
 
@@ -69,12 +70,12 @@
   --                         - end of options; 0 or more input filenames follow
  Backend selection:
   -b, --backend <name>       - select backend by name
-  -e, --eps                  - EPS backend (encapsulated PostScript) (default)
-  -p, --postscript           - PostScript backend
-  -s, --svg                  - SVG backend (scalable vector graphics)
-  -g, --pgm                  - PGM backend (portable greymap)
+  -b svg, -s, --svg          - SVG backend (scalable vector graphics)
   -b pdf                     - PDF backend (portable document format)
   -b pdfpage                 - fixed page-size PDF backend
+  -b eps, -e, --eps          - EPS backend (encapsulated PostScript) (default)
+  -b ps, -p, --postscript    - PostScript backend
+  -b pgm, -g, --pgm          - PGM backend (portable greymap)
   -b dxf                     - DXF backend (drawing interchange format)
   -b geojson                 - GeoJSON backend
   -b gimppath                - Gimppath backend (GNU Gimp)
@@ -125,7 +126,7 @@
  Dimensions can have optional units, e.g. 6.5in, 15cm, 100pt.
  Default is inches (or pixels for pgm, dxf, and gimppath backends).
  Possible input file formats are: pnm (pbm, pgm, ppm), bmp.
- Backends are: eps, postscript, ps, pdf, pdfpage, svg, dxf, geojson, pgm, 
+ Backends are: svg, pdf, pdfpage, eps, postscript, ps, dxf, geojson, pgm,
  gimppath, xfig.
 
 POTRACE LIBRARY (FOR DEVELOPERS)
@@ -159,6 +160,9 @@
 
  Copyright (C) 2001-2017 Peter Selinger
 
+ The use of the name "Potrace" is governed by a separate policy, see
+ TRADEMARKS below.
+
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or (at
@@ -176,6 +180,34 @@
 
  See the file COPYING for details.
 
+TRADEMARKS
+
+ "Potrace" is a trademark of Peter Selinger.
+
+ Policy on using the name "Potrace". If you are planning to modify
+ Potrace, including making a port of Potrace to another programming
+ language, please be aware of the following. While the source code of
+ Potrace is licensed under the GNU General Public License, the name
+ "Potrace" is my trademark, and may only be used with my permission.
+
+ In practice, I will permit the use of the name "Potrace" in
+ connection with a port of Potrace to another programming language,
+ provided that the port complies with the term of the GNU General
+ Public License and produces the same high quality vectorized output
+ as the original Potrace. Ports that are buggy or do not produce high
+ quality output are not permitted to use the name "Potrace". To ensure
+ compliance with this policy, please run your port by me before making
+ it public. Also, if you use the "Potrace" name (or any derivative,
+ such as "MyPotrace"), you must provide a name and email address where
+ I can reach you. Derivatives of Potrace that are posted anonymously
+ or where the authors cannot be reached or do not reply to email or
+ bug reports are not permitted to use the name "Potrace".
+
+ The purpose of this policy is to allow people to port Potrace to as
+ many programming languages as possible, while also ensuring that all
+ such ports are of the same high quality that has come to be
+ associated with the name "Potrace".
+
 GPG KEY
 
  The key fingerprint of Peter Selinger's GPG key is:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/README-WIN new/potrace-1.15/README-WIN
--- old/potrace-1.14/README-WIN 2015-09-17 14:20:06.000000000 +0200
+++ new/potrace-1.15/README-WIN 2017-08-05 02:55:44.000000000 +0200
@@ -10,8 +10,8 @@
 etc.
 
 
-INSTALLATION for Windows 95/98/2000/NT/XP/Vista/7/whatever:
-===========================================================
+INSTALLATION for Windows:
+=========================
 
 Download the file potrace-XXX.win32.zip (or potrace-XXX.win64.zip if
 you want the 64-bit version).  Unpack it with your favorite unzipping
@@ -29,10 +29,6 @@
 
         PATH=%PATH%;C:\DIRECTORY\WHERE\FILES\ARE
 
-Note: as of version 1.6, the Potrace Windows distribution is built
-using MinGW and not Cygwin. It is no longer necessary to install a
-separate DLL file with Potrace.
-
 
 RUNNING:
 ========
@@ -51,15 +47,3 @@
 
  potrace h:\data\*.*
  potrace h:/data/*.*
-
-Earlier versions of Potrace had some problems when wildcards and
-backslashes were mixed; these problems seem to have been solved by the
-switch from Cygwin to MinGW.
-
-Another problem that some users have reported is that the generated
-".ps" and ".eps" were not executable under Windows (i.e., one could
-not simply display these files by typing their name on the MSDOS
-Prompt, as should normally be the case if a default application for
-PostScript files has been configured). I was never able to replicate
-this problem, but I believe that it has also been solved by the switch
-to MinGW.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/check/Makefile.in 
new/potrace-1.15/check/Makefile.in
--- old/potrace-1.14/check/Makefile.in  2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/check/Makefile.in  2017-08-05 16:12:05.000000000 +0200
@@ -405,6 +405,7 @@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXTRA_INCLUDES = @EXTRA_INCLUDES@
 EXTRA_LIBS = @EXTRA_LIBS@
 EXTRA_OBJS = @EXTRA_OBJS@
 FGREP = @FGREP@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/config.guess 
new/potrace-1.15/config.guess
--- old/potrace-1.14/config.guess       2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/config.guess       2017-08-05 16:12:05.000000000 +0200
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2016 Free Software Foundation, Inc.
 
-timestamp='2016-04-02'
+timestamp='2016-10-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -186,9 +186,12 @@
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
-       # to ELF recently, or will in the future.
+       # to ELF recently (or will in the future) and ABI.
        case "${UNAME_MACHINE_ARCH}" in
-           arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
+           earm*)
+               os=netbsdelf
+               ;;
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
@@ -997,6 +1000,9 @@
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
+    mips64el:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     openrisc*:Linux:*:*)
        echo or1k-unknown-linux-${LIBC}
        exit ;;
@@ -1029,6 +1035,9 @@
     ppcle:Linux:*:*)
        echo powerpcle-unknown-linux-${LIBC}
        exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
        exit ;;
@@ -1408,18 +1417,17 @@
 cat >&2 <<EOF
 $0: unable to guess system type
 
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
 
   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patc...@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patc...@gnu.org to
+provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/config.h.in new/potrace-1.15/config.h.in
--- old/potrace-1.14/config.h.in        2017-02-20 03:49:38.000000000 +0100
+++ new/potrace-1.15/config.h.in        2017-08-05 16:12:04.000000000 +0200
@@ -87,6 +87,11 @@
 /* Version number of package */
 #undef VERSION
 
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT64_T
+
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
@@ -98,3 +103,7 @@
 
 /* Replacement function for strncasecmp */
 #undef strncasecmp
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint64_t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/config.sub new/potrace-1.15/config.sub
--- old/potrace-1.14/config.sub 2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/config.sub 2017-08-05 16:12:05.000000000 +0200
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2016 Free Software Foundation, Inc.
 
-timestamp='2016-03-30'
+timestamp='2016-11-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -117,7 +117,7 @@
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | 
kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | \
+  kopensolaris*-gnu* | cloudabi*-eabi* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -301,6 +301,7 @@
        | open8 | or1k | or1knd | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pru \
        | pyramid \
        | riscv32 | riscv64 \
        | rl78 | rx \
@@ -428,6 +429,7 @@
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pru-* \
        | pyramid-* \
        | riscv32-* | riscv64-* \
        | rl78-* | romp-* | rs6000-* | rx-* \
@@ -643,6 +645,14 @@
                basic_machine=m68k-bull
                os=-sysv3
                ;;
+       e500v[12])
+               basic_machine=powerpc-unknown
+               os=$os"spe"
+               ;;
+       e500v[12]-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=$os"spe"
+               ;;
        ebmon29k)
                basic_machine=a29k-amd
                os=-ebmon
@@ -1022,7 +1032,7 @@
        ppc-* | ppcbe-*)
                basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       ppcle | powerpclittle | ppc-le | powerpc-little)
+       ppcle | powerpclittle)
                basic_machine=powerpcle-unknown
                ;;
        ppcle-* | powerpclittle-*)
@@ -1032,7 +1042,7 @@
                ;;
        ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 
's/^[^-]*-//'`
                ;;
-       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+       ppc64le | powerpc64little)
                basic_machine=powerpc64le-unknown
                ;;
        ppc64le-* | powerpc64little-*)
@@ -1389,7 +1399,7 @@
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* 
\
-             | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | 
-linux-android* \
              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
@@ -1399,7 +1409,7 @@
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
              | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos*)
+             | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/configure new/potrace-1.15/configure
--- old/potrace-1.14/configure  2017-02-20 03:49:36.000000000 +0100
+++ new/potrace-1.15/configure  2017-08-05 16:12:03.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for potrace 1.14.
+# Generated by GNU Autoconf 2.69 for potrace 1.15.
 #
 # Report bugs to <selinger at users.sourceforge.net>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='potrace'
 PACKAGE_TARNAME='potrace'
-PACKAGE_VERSION='1.14'
-PACKAGE_STRING='potrace 1.14'
+PACKAGE_VERSION='1.15'
+PACKAGE_STRING='potrace 1.15'
 PACKAGE_BUGREPORT='selinger at users.sourceforge.net'
 PACKAGE_URL=''
 
@@ -639,6 +639,7 @@
 POTRACELIB_VERSION
 AM_CPPFLAGS
 EXTRA_LIBS
+EXTRA_INCLUDES
 EXTRA_OBJS
 MKBITMAP
 POTRACE
@@ -779,6 +780,7 @@
 enable_metric
 enable_a4
 enable_dumb_tty
+enable_local_getopt
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1340,7 +1342,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures potrace 1.14 to adapt to many kinds of systems.
+\`configure' configures potrace 1.15 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1411,7 +1413,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of potrace 1.14:";;
+     short | recursive ) echo "Configuration of potrace 1.15:";;
    esac
   cat <<\_ACEOF
 
@@ -1434,6 +1436,7 @@
   --enable-metric         use metric units (centimeters) as default
   --enable-a4             use a4 as the default papersize
   --enable-dumb-tty       use simplified ASCII-only progress bar
+  --enable-local-getopt   avoid using the system-wide getopt library
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1526,7 +1529,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-potrace configure 1.14
+potrace configure 1.15
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1937,11 +1940,65 @@
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+        'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 
1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by potrace $as_me 1.14, which was
+It was created by potrace $as_me 1.15, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2805,7 +2862,7 @@
 
 # Define the identity of the package.
  PACKAGE='potrace'
- VERSION='1.14'
+ VERSION='1.15'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2902,7 +2959,7 @@
 
 
 
-DATE="February 2017"
+DATE="August 2017"
 
 
 POTRACE=potrace
@@ -3772,8 +3829,8 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking what compiler options to 
use" >&5
 $as_echo_n "checking what compiler options to use... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAGS $CADD" >&5
-$as_echo "$CFLAGS $CADD" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CADD $CFLAGS" >&5
+$as_echo "$CADD $CFLAGS" >&6; }
 
 
 
@@ -12465,6 +12522,22 @@
 
 
 
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+  esac
+
+
+
 ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
 if test "x$ac_cv_func_getopt_long" = xyes; then :
   have_getopt_long=yes
@@ -12512,8 +12585,23 @@
 fi
 
 fi
-if test "$have_getopt_long" != "yes"; then
+
+# Check whether --enable-local-getopt was given.
+if test "${enable_local_getopt+set}" = set; then :
+  enableval=$enable_local_getopt;
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use local getopt" 
>&5
+$as_echo_n "checking whether to use local getopt... " >&6; }
+if test "$have_getopt_long" != "yes" || test "$enable_local_getopt" = yes; then
    EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o"
+   EXTRA_INCLUDES="$EXTRA_INCLUDES -I\$(srcdir)/include/getopt"
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
@@ -12637,6 +12725,7 @@
 
 
 
+
 ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile 
check/Makefile doc/potrace.1 doc/mkbitmap.1"
 
 cat >confcache <<\_ACEOF
@@ -13169,7 +13258,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by potrace $as_me 1.14, which was
+This file was extended by potrace $as_me 1.15, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13235,7 +13324,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-potrace config.status 1.14
+potrace config.status 1.15
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/configure.ac 
new/potrace-1.15/configure.ac
--- old/potrace-1.14/configure.ac       2017-02-20 01:55:26.000000000 +0100
+++ new/potrace-1.15/configure.ac       2017-08-04 21:20:42.000000000 +0200
@@ -6,13 +6,13 @@
 
 dnl ----------------------------------------------------------------------
 dnl Package info
-AC_INIT([potrace],[1.14],[selinger at users.sourceforge.net])
+AC_INIT([potrace],[1.15],[selinger at users.sourceforge.net])
 AC_CONFIG_SRCDIR(src/trace.c)
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 
-DATE="February 2017"
+DATE="August 2017"
 
 dnl ----------------------------------------------------------------------
 dnl The names of the installed executables are defined here, but
@@ -34,7 +34,7 @@
 AC_SUBST(CADD)
 
 AC_MSG_CHECKING(what compiler options to use)
-AC_MSG_RESULT($CFLAGS $CADD)
+AC_MSG_RESULT($CADD $CFLAGS)
 
 dnl ----------------------------------------------------------------------
 dnl check if --with-libpotrace was given - this must be done
@@ -192,6 +192,11 @@
 AC_CHECK_LIB(m, floor, true, AC_MSG_ERROR([cannot find the m library (-lm)]))
 
 dnl ----------------------------------------------------------------------
+dnl Check for types
+
+AC_TYPE_UINT64_T
+
+dnl ----------------------------------------------------------------------
 dnl Check for library functions.
 
 dnl Check for getopt_long
@@ -216,8 +221,17 @@
    [AC_MSG_RESULT(maybe (cross-compiling))
    have_getopt_long=no])
 fi
-if test "$have_getopt_long" != "yes"; then 
+
+AC_ARG_ENABLE(local-getopt,
+ AS_HELP_STRING([--enable-local-getopt],[avoid using the system-wide getopt 
library]))
+
+AC_MSG_CHECKING(whether to use local getopt)
+if test "$have_getopt_long" != "yes" || test "$enable_local_getopt" = yes; 
then 
    EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o"
+   EXTRA_INCLUDES="$EXTRA_INCLUDES -I\$(srcdir)/include/getopt"
+   AC_MSG_RESULT(yes)
+else
+   AC_MSG_RESULT(no)
 fi
 
 AC_CHECK_FUNC(strcasecmp, ,
@@ -255,6 +269,7 @@
 AC_SUBST(POTRACE)
 AC_SUBST(MKBITMAP)
 AC_SUBST(EXTRA_OBJS)
+AC_SUBST(EXTRA_INCLUDES)
 AC_SUBST(EXTRA_LIBS)
 AC_SUBST(AM_CPPFLAGS)
 AC_SUBST(POTRACELIB_VERSION)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/doc/Makefile.in 
new/potrace-1.15/doc/Makefile.in
--- old/potrace-1.14/doc/Makefile.in    2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/doc/Makefile.in    2017-08-05 16:12:05.000000000 +0200
@@ -185,6 +185,7 @@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXTRA_INCLUDES = @EXTRA_INCLUDES@
 EXTRA_LIBS = @EXTRA_LIBS@
 EXTRA_OBJS = @EXTRA_OBJS@
 FGREP = @FGREP@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/doc/potrace.1.in 
new/potrace-1.15/doc/potrace.1.in
--- old/potrace-1.14/doc/potrace.1.in   2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/doc/potrace.1.in   2017-08-02 19:50:36.000000000 +0200
@@ -14,7 +14,7 @@
 \fBpotrace\fP is a tool for tracing a bitmap, which means,
 transforming a bitmap into a smooth, scalable image.  The input is a
 bitmap, which means, a pixel-based image composed of the two colors
-black and white only. The output is EPS, PDF, SVG, or one of a number
+black and white only. The output is SVG, PDF, EPS, or one of a number
 of other vector formats. A typical use is to create vector graphics
 from scanned data, such as company or university logos, handwritten
 notes, etc. The resulting image is not "jaggy" like a bitmap, but
@@ -26,8 +26,8 @@
 black and white. If other pixel values appear in the input, they will
 be converted to black and white using a simple threshold method.
 
-\fBpotrace\fP can currently produce the following output formats: EPS,
-PostScript, PDF, SVG, DXF, GeoJSON, PGM, Gimppath, and XFig.
+\fBpotrace\fP can currently produce the following output formats: SVG,
+PDF, EPS, PostScript, DXF, GeoJSON, PGM, Gimppath, and XFig.
 Additional backends might be added in the future.
 .SH OPTIONS
 
@@ -91,14 +91,11 @@
 names can be abbreviated by a prefix as long as it is
 unambiguous. Backend names are case insensitive.
 .TP
-.B -e, --eps, -b eps, --backend eps
-EPS backend (default). The output is an encapsulated PostScript
-file. This is a single-page, variable-sized, dimension-based backend.
-.TP
-.B -p, --postscript, -b ps, --backend ps
-PostScript backend. The output is a PostScript file. This is a
-multi-page, fixed-size, dimension-based backend. If the input consists
-of multiple bitmaps, they are each rendered on a separate page.
+.B -s, --svg, -b svg, --backend svg
+SVG backend. The output is a Scalable Vector Graphics (SVG) file.
+This is a single-page, variable-sized, dimension-based backend. Note
+that unless the \fB-r\fP option is given, the resolution of the input
+bitmap is assumed to be 72dpi.
 .TP
 .B -b pdf, --backend pdf
 PDF backend. The output is a file in the Portable Document Format.  If
@@ -110,11 +107,14 @@
 The PDFPage backend is like the PDF backend, except that it is
 fixed-size like the PostScript backend.
 .TP
-.B -s, --svg, -b svg, --backend svg
-SVG backend. The output is a Scalable Vector Graphics (SVG) file.
-This is a single-page, variable-sized, dimension-based backend. Note
-that unless the \fB-r\fP option is given, the resolution of the input
-bitmap is assumed to be 72dpi.
+.B -e, --eps, -b eps, --backend eps
+EPS backend (default). The output is an encapsulated PostScript
+file. This is a single-page, variable-sized, dimension-based backend.
+.TP
+.B -p, --postscript, -b ps, --backend ps
+PostScript backend. The output is a PostScript file. This is a
+multi-page, fixed-size, dimension-based backend. If the input consists
+of multiple bitmaps, they are each rendered on a separate page.
 .TP
 .B -b dxf, --backend dxf
 DXF backend. The output is a file in the Drawing Interchange Format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/ltmain.sh new/potrace-1.15/ltmain.sh
--- old/potrace-1.14/ltmain.sh  2017-02-20 03:49:29.000000000 +0100
+++ new/potrace-1.15/ltmain.sh  2017-08-05 16:11:57.000000000 +0200
@@ -31,7 +31,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-1"
+VERSION="2.4.6 Debian-2.4.6-2"
 package_revision=2.4.6
 
 
@@ -1977,7 +1977,7 @@
 # End:
 
 # Set a version string.
-scriptversion='(GNU libtool) 2.4.6 Debian-2.4.6-1'
+scriptversion='(GNU libtool) 2.4.6'
 
 
 # func_echo ARG...
@@ -2068,7 +2068,7 @@
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname $scriptversion
+       version:        $progname $scriptversion Debian-2.4.6-2
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/Makefile.am 
new/potrace-1.15/src/Makefile.am
--- old/potrace-1.14/src/Makefile.am    2017-02-19 05:45:28.000000000 +0100
+++ new/potrace-1.15/src/Makefile.am    2017-08-04 21:05:15.000000000 +0200
@@ -32,6 +32,8 @@
 potracelib_demo_LDADD = libpotrace.la -lm
 potracelib_demo_DEPENDENCIES = libpotrace.la
 
+AM_CPPFLAGS = @EXTRA_INCLUDES@
+
 #----------------------------------------------------------------------
 # Potrace library:
 
@@ -42,7 +44,7 @@
 lib_LTLIBRARIES = $(INSTLIBS)
 EXTRA_LTLIBRARIES = libpotrace.la
 libpotrace_la_SOURCES = $(libsources)
-libpotrace_la_LDFLAGS = -version-info 0:4:0 -rpath '$(libdir)' \
+libpotrace_la_LDFLAGS = -version-info 0:5:0 -rpath '$(libdir)' \
  -export-symbols $(srcdir)/libpotrace-export.sym -no-undefined
 libpotrace_la_LIBADD = -lm
 MOSTLYCLEANFILES = libpotrace.la
@@ -54,4 +56,4 @@
 #----------------------------------------------------------------------
 # other stuff to distribute
 
-EXTRA_DIST = getopt.c getopt1.c getopt.h libpotrace-export.sym
+EXTRA_DIST = getopt.c getopt1.c include/getopt/getopt.h libpotrace-export.sym
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/Makefile.in 
new/potrace-1.15/src/Makefile.in
--- old/potrace-1.14/src/Makefile.in    2017-02-20 03:49:39.000000000 +0100
+++ new/potrace-1.15/src/Makefile.in    2017-08-05 16:12:06.000000000 +0200
@@ -228,7 +228,7 @@
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
-AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CPPFLAGS = @EXTRA_INCLUDES@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AS = @AS@
@@ -254,6 +254,7 @@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXTRA_INCLUDES = @EXTRA_INCLUDES@
 EXTRA_LIBS = @EXTRA_LIBS@
 EXTRA_OBJS = @EXTRA_OBJS@
 FGREP = @FGREP@
@@ -383,7 +384,7 @@
 lib_LTLIBRARIES = $(INSTLIBS)
 EXTRA_LTLIBRARIES = libpotrace.la
 libpotrace_la_SOURCES = $(libsources)
-libpotrace_la_LDFLAGS = -version-info 0:4:0 -rpath '$(libdir)' \
+libpotrace_la_LDFLAGS = -version-info 0:5:0 -rpath '$(libdir)' \
  -export-symbols $(srcdir)/libpotrace-export.sym -no-undefined
 
 libpotrace_la_LIBADD = -lm
@@ -395,7 +396,7 @@
 
 #----------------------------------------------------------------------
 # other stuff to distribute
-EXTRA_DIST = getopt.c getopt1.c getopt.h libpotrace-export.sym
+EXTRA_DIST = getopt.c getopt1.c include/getopt/getopt.h libpotrace-export.sym
 all: all-am
 
 .SUFFIXES:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/backend_eps.c 
new/potrace-1.15/src/backend_eps.c
--- old/potrace-1.14/src/backend_eps.c  2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/backend_eps.c  2017-08-05 15:28:19.000000000 +0200
@@ -8,7 +8,13 @@
    output. Postscript compression is optionally supplied via the
    functions in flate.c. */
 
-#define _XOPEN_SOURCE 500
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE 1
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/bitmap_io.c 
new/potrace-1.15/src/bitmap_io.c
--- old/potrace-1.14/src/bitmap_io.c    2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/bitmap_io.c    2017-08-02 19:40:01.000000000 +0200
@@ -689,11 +689,11 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
-         BM_UPUT(bm, x, y, col[i&1]);
+         BM_PUT(bm, x, y, col[i&1]);
          x++;
        }
       } else if (c == 0) {
@@ -719,7 +719,7 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
@@ -747,11 +747,11 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
-         BM_UPUT(bm, x, y, COLTABLE(c));
+         BM_PUT(bm, x, y, COLTABLE(c));
          x++;
        }
       } else if (c == 0) {
@@ -775,7 +775,7 @@
             x=0;
             y++;
           }
-          if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
             break;
           }
           realheight = y+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/decompose.c 
new/potrace-1.15/src/decompose.c
--- old/potrace-1.14/src/decompose.c    2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/decompose.c    2017-08-04 21:09:05.000000000 +0200
@@ -10,6 +10,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
 
 #include "potracelib.h"
 #include "curve.h"
@@ -199,7 +202,8 @@
    cannot have length 0). Sign is required for correct interpretation
    of turnpolicies. */
 static path_t *findpath(potrace_bitmap_t *bm, int x0, int y0, int sign, int 
turnpolicy) {
-  int x, y, dirx, diry, len, size, area;
+  int x, y, dirx, diry, len, size;
+  uint64_t area;
   int c, d, tmp;
   point_t *pt, *pt1;
   path_t *p = NULL;
@@ -276,7 +280,7 @@
 
   p->priv->pt = pt;
   p->priv->len = len;
-  p->area = area;
+  p->area = area <= INT_MAX ? area : INT_MAX; /* avoid overflow */
   p->sign = sign;
 
   return p;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/getopt.c 
new/potrace-1.15/src/getopt.c
--- old/potrace-1.14/src/getopt.c       2015-09-17 14:20:06.000000000 +0200
+++ new/potrace-1.15/src/getopt.c       2017-08-02 19:40:01.000000000 +0200
@@ -41,25 +41,6 @@
 
 #include <stdio.h>
 
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#  define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
 /* This needs to come after some library #include
    to get __GNU_LIBRARY__ defined.  */
 #ifdef __GNU_LIBRARY__
@@ -986,7 +967,6 @@
                           0);
 }
 
-#endif /* Not ELIDE_CODE.  */
 
 #ifdef TEST
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/getopt.h 
new/potrace-1.15/src/getopt.h
--- old/potrace-1.14/src/getopt.h       2015-09-17 14:20:06.000000000 +0200
+++ new/potrace-1.15/src/getopt.h       1970-01-01 01:00:00.000000000 +0100
@@ -1,180 +0,0 @@
-/* Declarations for getopt.
-   Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 
Floor,
-   Boston, MA 02110-1301, USA.  */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-/* If __GNU_LIBRARY__ is not already defined, either we are being used
-   standalone, or this is the first header included in the source file.
-   If we are being used with glibc, we need to include <features.h>, but
-   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
-   not defined, include <ctype.h>, which will pull in <features.h> for us
-   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
-   doesn't flood the namespace with stuff the way some other headers do.)  */
-#if !defined __GNU_LIBRARY__
-# include <ctype.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
-
-   On entry to `getopt', zero means this is the first call; initialize.
-
-   When `getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, `optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
-   for unrecognized options.  */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized.  */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
-   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of `struct option' terminated by an element containing a name which is
-   zero.
-
-   The field `has_arg' is:
-   no_argument         (or 0) if the option does not take an argument,
-   required_argument   (or 1) if the option requires an argument,
-   optional_argument   (or 2) if the option takes an optional argument.
-
-   If the field `flag' is not NULL, it points to a variable that is set
-   to the value given in the field `val' when the option is found, but
-   left unchanged if the option is not found.
-
-   To have a long-named option do something other than set an `int' to
-   a compiled-in constant, such as set a value from `optarg', set the
-   option's `flag' field to zero and its `val' field to a nonzero
-   value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero `flag' field, `getopt'
-   returns the contents of the `val' field.  */
-
-struct option
-{
-# if defined __STDC__ && __STDC__
-  const char *name;
-# else
-  char *name;
-# endif
-  /* has_arg can't be an enum because some compilers complain about
-     type mismatches in all the code that assumes it is an int.  */
-  int has_arg;
-  int *flag;
-  int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'.  */
-
-# define no_argument           0
-# define required_argument     1
-# define optional_argument     2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
-   arguments in ARGV (ARGC of them, minus the program name) for
-   options given in OPTS.
-
-   Return the option character from OPTS just read.  Return -1 when
-   there are no more options.  For unrecognized options, or options
-   missing arguments, `optopt' is set to the option letter, and '?' is
-   returned.
-
-   The OPTS string is a list of characters which are recognized option
-   letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in `optarg'.
-
-   If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU `getopt'.
-
-   The argument `--' causes premature termination of argument
-   scanning, explicitly telling `getopt' that there are no more
-   options.
-
-   If OPTS begins with `--', then non-option arguments are treated as
-   arguments to the option '\0'.  This behavior is specific to the GNU
-   `getopt'.  */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
-   differences in the consts, in stdlib.h.  To avoid compilation
-   errors, only prototype getopt for the GNU C library.  */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
-                       const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
-                            const char *shortopts,
-                            const struct option *longopts, int *longind);
-
-/* Internal only.  Users should not call this directly.  */
-extern int _getopt_internal (int argc, char *const *argv,
-                            const char *shortopts,
-                            const struct option *longopts, int *longind,
-                            int long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations.  */
-#undef __need_getopt
-
-#endif /* getopt.h */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/getopt1.c 
new/potrace-1.15/src/getopt1.c
--- old/potrace-1.14/src/getopt1.c      2015-09-17 14:20:06.000000000 +0200
+++ new/potrace-1.15/src/getopt1.c      2017-08-02 19:40:01.000000000 +0200
@@ -34,25 +34,6 @@
 
 #include <stdio.h>
 
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
 /* This needs to come after some library #include
    to get __GNU_LIBRARY__ defined.  */
 #ifdef __GNU_LIBRARY__
@@ -91,7 +72,6 @@
 }
 
 
-#endif /* Not ELIDE_CODE.  */
 
 #ifdef TEST
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/greymap.c 
new/potrace-1.15/src/greymap.c
--- old/potrace-1.14/src/greymap.c      2017-02-19 06:10:51.000000000 +0100
+++ new/potrace-1.15/src/greymap.c      2017-08-02 19:40:01.000000000 +0200
@@ -845,11 +845,11 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
-         GM_UPUT(gm, x, y, col[i&1]);
+         GM_PUT(gm, x, y, col[i&1]);
          x++;
        }
       } else if (c == 0) {
@@ -875,7 +875,7 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
@@ -903,11 +903,11 @@
            x=0;
            y++;
          }
-         if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
            break;
          }
           realheight = y+1;
-         GM_UPUT(gm, x, y, COLTABLE(c));
+         GM_PUT(gm, x, y, COLTABLE(c));
          x++;
        }
       } else if (c == 0) {
@@ -931,7 +931,7 @@
             x=0;
             y++;
           }
-          if (y>=bmpinfo.h) {
+         if (x>=bmpinfo.w || y>=bmpinfo.h) {
             break;
           }
           realheight = y+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/greymap.h 
new/potrace-1.15/src/greymap.h
--- old/potrace-1.14/src/greymap.h      2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/greymap.h      2017-08-02 19:40:01.000000000 +0200
@@ -41,7 +41,7 @@
 #define GM_INC(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UINC(gm, x, y, b) : 0)
 #define GM_INV(gm, x, y) (gm_safe(gm, x, y) ? GM_UINV(gm, x, y) : 0)
 #define GM_PUT(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UPUT(gm, x, y, b) : 0)
-#define GM_BGET(gm, x, y) GM_UGET(gm, gm_bound(x, gm->w), gm_bound(y, gm->h))
+#define GM_BGET(gm, x, y) ((gm)->w == 0 || (gm)->h == 0 ? 0 : GM_UGET(gm, 
gm_bound(x, (gm)->w), gm_bound(y, (gm)->h)))
 
 /* modes for cutting off out-of-range values. The following names
    refer to winding numbers. I.e., make a pixel black if winding
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/include/getopt/getopt.h 
new/potrace-1.15/src/include/getopt/getopt.h
--- old/potrace-1.14/src/include/getopt/getopt.h        1970-01-01 
01:00:00.000000000 +0100
+++ new/potrace-1.15/src/include/getopt/getopt.h        2017-08-02 
19:40:01.000000000 +0200
@@ -0,0 +1,180 @@
+/* Declarations for getopt.
+   Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 
Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef _GETOPT_H
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+   standalone, or this is the first header included in the source file.
+   If we are being used with glibc, we need to include <features.h>, but
+   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
+   not defined, include <ctype.h>, which will pull in <features.h> for us
+   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
+   doesn't flood the namespace with stuff the way some other headers do.)  */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument         (or 0) if the option does not take an argument,
+   required_argument   (or 1) if the option requires an argument,
+   optional_argument   (or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+# if defined __STDC__ && __STDC__
+  const char *name;
+# else
+  char *name;
+# endif
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+# define no_argument           0
+# define required_argument     1
+# define optional_argument     2
+#endif /* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, `optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in `optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU `getopt'.
+
+   The argument `--' causes premature termination of argument
+   scanning, explicitly telling `getopt' that there are no more
+   options.
+
+   If OPTS begins with `--', then non-option arguments are treated as
+   arguments to the option '\0'.  This behavior is specific to the GNU
+   `getopt'.  */
+
+#if defined __STDC__ && __STDC__
+# ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+# else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+# endif /* __GNU_LIBRARY__ */
+
+# ifndef __need_getopt
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+                       const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+                            const char *shortopts,
+                            const struct option *longopts, int *longind);
+
+/* Internal only.  Users should not call this directly.  */
+extern int _getopt_internal (int argc, char *const *argv,
+                            const char *shortopts,
+                            const struct option *longopts, int *longind,
+                            int long_only);
+# endif
+#else /* not __STDC__ */
+extern int getopt ();
+# ifndef __need_getopt
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+# endif
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations.  */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/main.c new/potrace-1.15/src/main.c
--- old/potrace-1.14/src/main.c 2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/main.c 2017-08-05 15:28:00.000000000 +0200
@@ -2,7 +2,13 @@
    This file is part of Potrace. It is free software and it is covered
    by the GNU General Public License. See the file COPYING for details. */
 
-#define _XOPEN_SOURCE 500
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE 1
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -101,12 +107,12 @@
 typedef struct backend_s backend_t;  
 
 static backend_t backend[] = {
+  { "svg",        ".svg", 0, 0, 0,   NULL,     page_svg,     NULL,     1 },
+  { "pdf",        ".pdf", 0, 0, 1,   init_pdf, page_pdf,     term_pdf, 1 },
+  { "pdfpage",    ".pdf", 1, 0, 1,   init_pdf, page_pdfpage, term_pdf, 1 },
   { "eps",        ".eps", 0, 0, 0,   NULL,     page_eps,     NULL,     1 },
   { "postscript", ".ps",  1, 0, 1,   init_ps,  page_ps,      term_ps,  1 },
   { "ps",         ".ps",  1, 0, 1,   init_ps,  page_ps,      term_ps,  1 },
-  { "pdf",        ".pdf", 0, 0, 1,   init_pdf, page_pdf,     term_pdf, 1 },
-  { "pdfpage",    ".pdf", 1, 0, 1,   init_pdf, page_pdfpage, term_pdf, 1 },
-  { "svg",        ".svg", 0, 0, 0,   NULL,     page_svg,     NULL,     1 },
   { "dxf",        ".dxf", 0, 1, 0,   NULL,     page_dxf,     NULL,     1 },
   { "geojson",    ".json",0, 1, 0,   NULL,     page_geojson, NULL,     1 },
   { "pgm",        ".pgm", 0, 1, 1,   NULL,     page_pgm,     NULL,     1 },
@@ -203,12 +209,12 @@
   fprintf(f, " --                         - end of options; 0 or more input 
filenames follow\n");
   fprintf(f, "Backend selection:\n");
   fprintf(f, " -b, --backend <name>       - select backend by name\n");
-  fprintf(f, " -e, --eps                  - EPS backend (encapsulated 
PostScript) (default)\n");
-  fprintf(f, " -p, --postscript           - PostScript backend\n");
-  fprintf(f, " -s, --svg                  - SVG backend (scalable vector 
graphics)\n");
-  fprintf(f, " -g, --pgm                  - PGM backend (portable greymap)\n");
+  fprintf(f, " -b svg, -s, --svg          - SVG backend (scalable vector 
graphics)\n");
   fprintf(f, " -b pdf                     - PDF backend (portable document 
format)\n");
   fprintf(f, " -b pdfpage                 - fixed page-size PDF backend\n");
+  fprintf(f, " -b eps, -e, --eps          - EPS backend (encapsulated 
PostScript) (default)\n");
+  fprintf(f, " -b ps, -p, --postscript    - PostScript backend\n");
+  fprintf(f, " -b pgm, -g, --pgm          - PGM backend (portable greymap)\n");
   fprintf(f, " -b dxf                     - DXF backend (drawing interchange 
format)\n");
   fprintf(f, " -b geojson                 - GeoJSON backend\n");
   fprintf(f, " -b gimppath                - Gimppath backend (GNU Gimp)\n");
@@ -613,8 +619,8 @@
       }
       parse_dimensions(optarg, &p, &dimx, &dimy);
       if (*p == 0) {
-       info.paperwidth = (int)rint(double_of_dim(dimx, DEFAULT_DIM));
-       info.paperheight = (int)rint(double_of_dim(dimy, DEFAULT_DIM));
+       info.paperwidth = (int)round(double_of_dim(dimx, DEFAULT_DIM));
+       info.paperheight = (int)round(double_of_dim(dimy, DEFAULT_DIM));
        break;
       }
       if (matches == 0) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/mkbitmap.c 
new/potrace-1.15/src/mkbitmap.c
--- old/potrace-1.14/src/mkbitmap.c     2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/mkbitmap.c     2017-08-05 15:28:06.000000000 +0200
@@ -7,7 +7,13 @@
    filter (evening out background gradients), lowpass filter
    (smoothing foreground details), interpolated scaling, inversion. */
 
-#define _XOPEN_SOURCE 500
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE 1
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -332,9 +338,9 @@
            v += window[k][i] * poly[l][i];
          }
          if (bilevel) {
-           BM_UPUT(bm_out, x*s+l, y*s+k, v < c1);
+           BM_PUT(bm_out, x*s+l, y*s+k, v < c1);
          } else {
-           GM_UPUT(gm_out, x*s+l, y*s+k, v);
+           GM_PUT(gm_out, x*s+l, y*s+k, v);
          }         
        }
       }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/potracelib.h 
new/potrace-1.15/src/potracelib.h
--- old/potrace-1.14/src/potracelib.h   2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/potracelib.h   2017-08-02 19:40:01.000000000 +0200
@@ -121,7 +121,7 @@
 /* free parameter set */
 void potrace_param_free(potrace_param_t *p);
 
-/* trace a bitmap*/
+/* trace a bitmap */
 potrace_state_t *potrace_trace(const potrace_param_t *param, 
                               const potrace_bitmap_t *bm);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/potrace-1.14/src/trace.c new/potrace-1.15/src/trace.c
--- old/potrace-1.14/src/trace.c        2017-02-19 05:39:08.000000000 +0100
+++ new/potrace-1.15/src/trace.c        2017-08-03 08:31:59.000000000 +0200
@@ -282,9 +282,9 @@
     y = pp->pt[i].y - pp->y0;
     pp->sums[i+1].x = pp->sums[i].x + x;
     pp->sums[i+1].y = pp->sums[i].y + y;
-    pp->sums[i+1].x2 = pp->sums[i].x2 + x*x;
-    pp->sums[i+1].xy = pp->sums[i].xy + x*y;
-    pp->sums[i+1].y2 = pp->sums[i].y2 + y*y;
+    pp->sums[i+1].x2 = pp->sums[i].x2 + (double)x*x;
+    pp->sums[i+1].xy = pp->sums[i].xy + (double)x*y;
+    pp->sums[i+1].y2 = pp->sums[i].y2 + (double)y*y;
   }
   return 0;  
 


Reply via email to