From d1cb0d037c9e069931e84cad39215e8cf856b1cc Mon Sep 17 00:00:00 2001 From: andrewtappert Date: Wed, 17 Aug 2016 13:24:47 -0400 Subject: [PATCH] Fix off-by-one calculating size of padding written upon timeout. (#17) --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 2a4d335..82b032a 100644 --- a/src/main.c +++ b/src/main.c @@ -222,7 +222,7 @@ static void write_range(struct resource * res) { if (timeout > 0 && ktime_to_ms(ktime_sub(end, start)) > timeout) { DBG("Reading is too slow. Skipping Range..."); - write_padding(res->end - i - is); + write_padding(res->end - i + 1 - is); break; } }