about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-03-15 00:34:59 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-03-15 00:34:59 +0000
commitb7cd16e68be723fdb25725de1d59763fc7272fae (patch)
treef0c81e733b6003af6bb7ab12c73180f70388379e
parent99a1345ecefc62f1ff2d0ccfe41c90abc657995c (diff)
downloadnetpbm-mirror-b7cd16e68be723fdb25725de1d59763fc7272fae.tar.gz
netpbm-mirror-b7cd16e68be723fdb25725de1d59763fc7272fae.tar.xz
netpbm-mirror-b7cd16e68be723fdb25725de1d59763fc7272fae.zip
Release 10.86.10
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3750 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY9
-rw-r--r--editor/pamdice.c18
-rwxr-xr-xeditor/pnmquantall1
-rw-r--r--version.mk2
4 files changed, 20 insertions, 10 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 2b9f83aa..8955dccd 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,15 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+20.03.15 BJH  Release 10.86.10
+
+              pamdice: Fix crash when -width or -height is zero.
+
+              pamdice: Fix incorrect file names when -outstem contains "%s",
+              etc.
+
+              pnmquantall: remove accidentally published debugging trace.
+
 20.02.14 BJH  Release 10.86.09
 
               pamdice: Fix junk output when -width or -height not specified.
diff --git a/editor/pamdice.c b/editor/pamdice.c
index f4b05a8d..32881129 100644
--- a/editor/pamdice.c
+++ b/editor/pamdice.c
@@ -84,7 +84,9 @@ parseCommandLine(int argc, char ** argv,
         /* Uses and sets argc, argv, and some of *cmdline_p and others. */
 
     if (cmdlineP->sliceVertically) {
-        if (hoverlapSpec) {
+        if (cmdlineP->width < 1)
+            pm_error("-width value must not be zero");
+        else if (hoverlapSpec) {
             if (cmdlineP->hoverlap > cmdlineP->width - 1)
                 pm_error("-hoverlap value must be less than -width (%u).  "
                          "You specified %u.",
@@ -93,7 +95,9 @@ parseCommandLine(int argc, char ** argv,
             cmdlineP->hoverlap = 0;
     }
     if (cmdlineP->sliceHorizontally) {
-        if (voverlapSpec) {
+        if (cmdlineP->height < 1)
+            pm_error("-height value must not be zero");
+        else if (voverlapSpec) {
             if (cmdlineP->voverlap > cmdlineP->height - 1)
                 pm_error("-voverlap value must be less than -height (%u).  "
                          "You specified %u.",
@@ -209,7 +213,6 @@ ndigits(unsigned int const arg) {
 
 static void
 computeOutputFilenameFormat(int           const format, 
-                            char          const outstem[],
                             unsigned int  const nHorizSlice,
                             unsigned int  const nVertSlice,
                             const char ** const filenameFormatP) {
@@ -224,9 +227,8 @@ computeOutputFilenameFormat(int           const format,
     default:       filenameSuffix = "";    break;
     }
     
-    pm_asprintf(filenameFormatP, "%s_%%0%uu_%%0%uu.%s",
-                outstem, ndigits(nHorizSlice), ndigits(nVertSlice),
-                filenameSuffix);
+    pm_asprintf(filenameFormatP, "%%s_%%0%uu_%%0%uu.%s",
+                ndigits(nHorizSlice), ndigits(nVertSlice), filenameSuffix);
 
     if (*filenameFormatP == NULL)
         pm_error("Unable to allocate memory for filename format string");
@@ -253,13 +255,13 @@ openOutStreams(struct pam   const inpam,
     const char * filenameFormat;
     unsigned int vertSlice;
 
-    computeOutputFilenameFormat(inpam.format, outstem, nHorizSlice, nVertSlice,
+    computeOutputFilenameFormat(inpam.format, nHorizSlice, nVertSlice,
                                 &filenameFormat);
 
     for (vertSlice = 0; vertSlice < nVertSlice; ++vertSlice) {
         const char * filename;
 
-        pm_asprintf(&filename, filenameFormat, horizSlice, vertSlice);
+        pm_asprintf(&filename, filenameFormat, outstem, horizSlice, vertSlice);
 
         if (filename == NULL)
             pm_error("Unable to allocate memory for output filename");
diff --git a/editor/pnmquantall b/editor/pnmquantall
index d268227d..aea6cc84 100755
--- a/editor/pnmquantall
+++ b/editor/pnmquantall
@@ -205,7 +205,6 @@ if (!defined($colorMapFh)) {
 if (!$progError) {
     makeColorMap(\@fileNames, $newColorCt, $colorMapFileName, \$progError);
 }
-print ("got color map\n");
 if (!$progError) {
     remapFiles(\@fileNames, $colorMapFileName, $ext, \$progError);
 }
diff --git a/version.mk b/version.mk
index ca222f1d..4e02899e 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 86
-NETPBM_POINT_RELEASE = 9
+NETPBM_POINT_RELEASE = 10