]> git.neil.brown.name Git - wiggle.git/commitdiff
Removed malloc.h, fixed off-by-one in bestmatch.c, it was silent in Linux and deadly...
authorAlexandre Carmel-Veilleux <acv@miniguru.ca>
Fri, 2 Dec 2011 13:55:08 +0000 (08:55 -0500)
committerNeil Brown <neilb@suse.de>
Wed, 7 Dec 2011 23:15:38 +0000 (10:15 +1100)
Signed-off-by: Neil Brown <neilb@suse.de>
bestmatch.c
diff.c
dotest [changed mode: 0755->0644]
extract.c
load.c
merge2.c
split.c
vpatch.c

index c59bc78e80351f8d1c6942c27a557b0fe3566f4b..1d5515bdf232541a606b8ef17668f3d6b505051c 100644 (file)
@@ -61,7 +61,6 @@
  * many fewer symbols.
  */
 
-#include       <malloc.h>
 #include       <ctype.h>
 #include       <stdlib.h>
 #include       "wiggle.h"
@@ -392,6 +391,11 @@ static void remap(struct best *best, int cnt,
                while (pb > 0 && is_skipped(b2.list[pb-1]))
                        pb--;
 
+               if (pa <= 0)
+                       pa = 1;
+               if (pb <= 0)
+                       pb = 1;
+
                best[b].xlo = pa;
                best[b].ylo = pb;
 
diff --git a/diff.c b/diff.c
index 8c0463a1a3eb205f74761dd5faa6b256637be0e4..51d842167b70251a85b08bbe34f89d637164f11e 100644 (file)
--- a/diff.c
+++ b/diff.c
  *
  */
 
-#include       <malloc.h>
 #include       "wiggle.h"
 #include       <stdlib.h>
 
diff --git a/dotest b/dotest
old mode 100755 (executable)
new mode 100644 (file)
index f3b6903..a65c42b
--- a/dotest
+++ b/dotest
@@ -1,5 +1,13 @@
 #!/bin/bash
 
+# Redirect for non-GNU time systems
+if [ "xxTIME_CMD" = "xx" ]
+then
+  time_cmd=/usr/bin/time
+else
+  time_cmd=$TIME_CMD
+fi
+
 dir=$PWD
 
 while [ ! -f $dir/wiggle ]
@@ -16,7 +24,7 @@ if [ -d tests ]
 then cd tests
 fi
 
-TIME="/usr/bin/time -o .time -f %U"
+TIME="$time_cmd -o .time -f %U"
 if $TIME true > /dev/null 2>&1
 then :
 else TIME=
index dc695dd7fc83bba884e4ae8cb1ebac9d5c8ea44f..f7ee0dcccf8d8d68868992fd70bbff51d996d414 100644 (file)
--- a/extract.c
+++ b/extract.c
@@ -29,7 +29,6 @@
  */
 
 #include       "wiggle.h"
-#include       <malloc.h>
 #include       <stdlib.h>
 
 static void skip_eol(char **cp, char *end)
diff --git a/load.c b/load.c
index 979175b60db8834aaf90a5b476db2e5b37104e25..1da2b6fba867351a4f16067988b28e93929f7cae 100644 (file)
--- a/load.c
+++ b/load.c
@@ -38,7 +38,7 @@
 #include       <sys/stat.h>
 #include       <unistd.h>
 #include       <fcntl.h>
-#include       <malloc.h>
+#include       <stdlib.h>
 
 static void join_streams(struct stream list[], int cnt)
 {
index 3d86c33b39bd909703411495cdc10d76b7c70c5e..c25b2d8d4e465a604284318653b1b5e3c2396283 100644 (file)
--- a/merge2.c
+++ b/merge2.c
@@ -25,7 +25,6 @@
 
 #include "wiggle.h"
 #include <stdlib.h>
-#include <malloc.h>
 
 /*
  * Second attempt at merging....
diff --git a/split.c b/split.c
index 0562310f74ce8c6a5b840f9395ab31b678769faa..f38ba04405e72d7247be7be49be5992768b4f166 100644 (file)
--- a/split.c
+++ b/split.c
@@ -45,7 +45,7 @@
 #include       "wiggle.h"
 #include       <stdlib.h>
 #include       <ctype.h>
-#include       <malloc.h>
+#include       <stdlib.h>
 #define BITS_PER_LONG 32
 
 #include "hash.h"
index 256d9c4e2c632da1e4c749e70068a5166d61ca00..21de2bb7545de04871433fb7ab274ceb1c4ab487 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -38,7 +38,6 @@
  */
 
 #include "wiggle.h"
-#include <malloc.h>
 #include <curses.h>
 #include <unistd.h>
 #include <stdlib.h>