diff options
Diffstat (limited to 'xdiff')
-rw-r--r-- | xdiff/xemit.c | 4 | ||||
-rw-r--r-- | xdiff/xhistogram.c | 2 | ||||
-rw-r--r-- | xdiff/xpatience.c | 2 | ||||
-rw-r--r-- | xdiff/xutils.c | 4 |
4 files changed, 2 insertions, 10 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c index 7778dc2b19..30713ae9a9 100644 --- a/xdiff/xemit.c +++ b/xdiff/xemit.c @@ -210,7 +210,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, if (fs1 < 0) fs1 = 0; if (fs1 < s1) { - s2 -= s1 - fs1; + s2 = XDL_MAX(s2 - (s1 - fs1), 0); s1 = fs1; } } @@ -232,7 +232,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, if (fe1 < 0) fe1 = xe->xdf1.nrec; if (fe1 > e1) { - e2 += fe1 - e1; + e2 = XDL_MIN(e2 + (fe1 - e1), xe->xdf2.nrec); e1 = fe1; } diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index ec85f5992b..c7b35a9667 100644 --- a/xdiff/xhistogram.c +++ b/xdiff/xhistogram.c @@ -42,8 +42,6 @@ */ #include "xinclude.h" -#include "xtypes.h" -#include "xdiff.h" #define MAX_PTR UINT_MAX #define MAX_CNT UINT_MAX diff --git a/xdiff/xpatience.c b/xdiff/xpatience.c index f3573d9f00..3c5601b602 100644 --- a/xdiff/xpatience.c +++ b/xdiff/xpatience.c @@ -20,8 +20,6 @@ * */ #include "xinclude.h" -#include "xtypes.h" -#include "xdiff.h" /* * The basic idea of patience diff is to find lines that are unique in diff --git a/xdiff/xutils.c b/xdiff/xutils.c index 963e1c58b9..cfa6e2220f 100644 --- a/xdiff/xutils.c +++ b/xdiff/xutils.c @@ -20,13 +20,9 @@ * */ -#include <limits.h> -#include <assert.h> #include "xinclude.h" - - long xdl_bogosqrt(long n) { long i; |