[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (3eabb6c3a2f334b185c8a993360fba459160bdf9)



The branch, master has been updated
       via  3eabb6c3a2f334b185c8a993360fba459160bdf9 (commit)
      from  14fe70f2e226524fd95dd8a3012f1e0dec9191f8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/action.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


=================
 Commit Messages
=================

commit 3eabb6c3a2f334b185c8a993360fba459160bdf9
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Avoid divide-by-zero
    
    Check for a zero dispersion before computing it.

:100644 100644 e931fe9... 8924d20... M	src/action.c

=========
 Changes
=========

commit 3eabb6c3a2f334b185c8a993360fba459160bdf9
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Avoid divide-by-zero
    
    Check for a zero dispersion before computing it.

diff --git a/src/action.c b/src/action.c
index e931fe9..8924d20 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7112,8 +7112,11 @@ ActionElementList (int argc, char **argv, int x, int y)
       ny = parse_layout_attribute_units ("import::newY", ny);
       d = parse_layout_attribute_units ("import::disperse", d);
 
-      nx += random () % (d*2) - d;
-      ny += random () % (d*2) - d;
+      if (d > 0)
+	{
+	  nx += random () % (d*2) - d;
+	  ny += random () % (d*2) - d;
+	}
 
       if (nx < 0)
 	nx = 0;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs