summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2009-10-26 02:41:37 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2009-10-26 02:41:37 +0000
commit6731dfb89d79d9a9a890e67ba235e2aac7ee015f (patch)
tree3cf9f0cf910747e56fc5e8da3503ced672a094f1
parent0fef30425e5fd7151a71dc3e63a9687caada1c96 (diff)
All tests pass.
-rw-r--r--xdelta3/xdelta3-main.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h
index 1aaef4f..648ae1d 100644
--- a/xdelta3/xdelta3-main.h
+++ b/xdelta3/xdelta3-main.h
@@ -2849,6 +2849,7 @@ main_set_source (xd3_stream *stream, xd3_cmd cmd,
2849 XD3_ASSERT (stream->src == source); 2849 XD3_ASSERT (stream->src == source);
2850 2850
2851 lru_size = (option_srcwinsz + source->blksize - 1) / source->blksize; 2851 lru_size = (option_srcwinsz + source->blksize - 1) / source->blksize;
2852 lru_size = max(lru_size, 1U);
2852 option_srcwinsz = lru_size * source->blksize; 2853 option_srcwinsz = lru_size * source->blksize;
2853 2854
2854 if (option_verbose) 2855 if (option_verbose)
@@ -2943,7 +2944,7 @@ main_getblk_func (xd3_stream *stream,
2943 xoff_t pos = blkno * source->blksize; 2944 xoff_t pos = blkno * source->blksize;
2944 main_file *sfile = (main_file*) source->ioh; 2945 main_file *sfile = (main_file*) source->ioh;
2945 main_blklru *blru = NULL; 2946 main_blklru *blru = NULL;
2946 usize_t nread; 2947 usize_t nread = 0;
2947 usize_t i; 2948 usize_t i;
2948 2949
2949 if (allow_fake_source) 2950 if (allow_fake_source)
@@ -3007,6 +3008,10 @@ main_getblk_func (xd3_stream *stream,
3007 } 3008 }
3008 lru_misses += 1; 3009 lru_misses += 1;
3009 } 3010 }
3011 else
3012 {
3013 XD3_ASSERT(0);
3014 }
3010 3015
3011 lru_filled += 1; 3016 lru_filled += 1;
3012 3017
@@ -3117,7 +3122,7 @@ main_input (xd3_cmd cmd,
3117{ 3122{
3118 int ret; 3123 int ret;
3119 xd3_stream stream; 3124 xd3_stream stream;
3120 usize_t nread; 3125 usize_t nread = 0;
3121 usize_t winsize; 3126 usize_t winsize;
3122 int stream_flags = 0; 3127 int stream_flags = 0;
3123 xd3_config config; 3128 xd3_config config;