about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-27 19:07:23 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-27 19:07:23 +0000
commit8c5ba4084a05b489e9de867ab620716438562ec5 (patch)
tree83cdb599f6e33aea74e9511f115bfbbbd1f5913b /generator
parent839ede66d2d296faf5736d442df82b0e8d201240 (diff)
downloadnetpbm-mirror-8c5ba4084a05b489e9de867ab620716438562ec5.tar.gz
netpbm-mirror-8c5ba4084a05b489e9de867ab620716438562ec5.tar.xz
netpbm-mirror-8c5ba4084a05b489e9de867ab620716438562ec5.zip
Fail if -dimension is greater than 5
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4073 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/ppmforge.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/generator/ppmforge.c b/generator/ppmforge.c
index c7cfdb84..7cef571f 100644
--- a/generator/ppmforge.c
+++ b/generator/ppmforge.c
@@ -34,6 +34,7 @@
 #define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
+#include <float.h>
 #include <assert.h>
 
 #include "pm_c_util.h"
@@ -169,6 +170,11 @@ parseCommandLine(int argc, const char **argv,
         if (cmdlineP->dimension <= 0.0)
             pm_error("-dimension must be greater than zero.  "
                      "You specified %f", cmdlineP->dimension);
+        else if (cmdlineP->dimension > 5.0 + FLT_EPSILON)
+            pm_error("-dimension must not be greater than 5.  "
+                     "Results are not interesting with higher numbers, so "
+                     "we assume it is a mistake.  "
+                     "You specified %f", cmdlineP->dimension);
     } else
         cmdlineP->dimension = cmdlineP->clouds ? 2.15 : 2.4;