#! /bin/sh /usr/share/dpatch/dpatch-run
## jmlib_sigfpe.dpatch by  <Helmut Grohne <helmut@subdivi.de>>
## DP: Rejects zero length to avoid division by zero.

@DPATCH@
diff -urNad jugglemaster-0.4~/src/jmlib/jmlib.cpp jugglemaster-0.4/src/jmlib/jmlib.cpp
--- jugglemaster-0.4~/src/jmlib/jmlib.cpp	2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmlib/jmlib.cpp	2007-09-22 00:39:03.000000000 +0200
@@ -255,6 +255,10 @@
     error("Style name too long");
     return false;
   }
+  if (length == 0) {
+    error("Style name too short");
+    return false;
+  }
   
   strcpy(stylename, name);
   memcpy(styledata, data + offset, length*4);
