aboutsummaryrefslogtreecommitdiffstats
path: root/devel/simulavr
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2005-01-13 06:16:02 +0800
committerjoerg <joerg@FreeBSD.org>2005-01-13 06:16:02 +0800
commit03e732d56389a43242efb4218cb484d0b9e02535 (patch)
treeefd3d3392d3293f0961dd95572059821604c2888 /devel/simulavr
parent43ab71879c65e63008ea33e4c34741421634440e (diff)
downloadfreebsd-ports-graphics-03e732d56389a43242efb4218cb484d0b9e02535.tar.gz
freebsd-ports-graphics-03e732d56389a43242efb4218cb484d0b9e02535.tar.zst
freebsd-ports-graphics-03e732d56389a43242efb4218cb484d0b9e02535.zip
Fix a possible division by zero condition that can happen for very
short (< 1 ms) simulations.
Diffstat (limited to 'devel/simulavr')
-rw-r--r--devel/simulavr/Makefile2
-rw-r--r--devel/simulavr/files/patch-src::avrcore.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/devel/simulavr/Makefile b/devel/simulavr/Makefile
index 944cc1ecfb5..d00bcd71e79 100644
--- a/devel/simulavr/Makefile
+++ b/devel/simulavr/Makefile
@@ -7,7 +7,7 @@
PORTNAME= simulavr
PORTVERSION= 0.1.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/devel/simulavr/files/patch-src::avrcore.c b/devel/simulavr/files/patch-src::avrcore.c
new file mode 100644
index 00000000000..a5e1ce605e7
--- /dev/null
+++ b/devel/simulavr/files/patch-src::avrcore.c
@@ -0,0 +1,12 @@
+--- src/avrcore.c.orig Fri Jan 2 04:01:01 2004
++++ src/avrcore.c Wed Jan 12 22:31:53 2005
+@@ -1067,6 +1067,9 @@
+
+ signal_watch_stop (SIGINT);
+
++ /* avoid division by zero below */
++ if (run_time == 0) run_time = 1;
++
+ avr_message ("Run time was %lld.%03lld seconds.\n", run_time / 1000,
+ run_time % 1000);
+ avr_message ("Executed %lld instructions.\n", cnt);