Commit 90ffe1c9 authored by Allard van Mossel's avatar Allard van Mossel Committed by Guolin Ke
Browse files

Fixed bug where reads could be attempted in an index > read_cnt (#57)

parent a194045c
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
++i; ++i;
++total_cnt; ++total_cnt;
// skip end of line // skip end of line
while (buffer_process[i] == '\n' || buffer_process[i] == '\r') { ++i; } while ((buffer_process[i] == '\n' || buffer_process[i] == '\r') && i < read_cnt) { ++i; }
last_i = i; last_i = i;
} }
else { else {
...@@ -247,7 +247,7 @@ public: ...@@ -247,7 +247,7 @@ public:
++i; ++i;
++total_cnt; ++total_cnt;
// skip end of line // skip end of line
while (buffer_process[i] == '\n' || buffer_process[i] == '\r') { ++i; } while ((buffer_process[i] == '\n' || buffer_process[i] == '\r') && i < read_cnt) { ++i; }
last_i = i; last_i = i;
} }
else { else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment