Do not subtract 1 each time, just use < instead of <= in d5p1.
This commit is contained in:
parent
3b277352d1
commit
c1f11c1ebc
@ -52,7 +52,7 @@ int main(int argc, char **argv) {
|
||||
sscanf(line, "%lu %lu %lu\n", &dst, &src, &rng);
|
||||
|
||||
for (size_t i = 0; i < data_len; ++i) {
|
||||
if (!data_v[i] && data[i] >= src && data[i] <= src+rng-1) {
|
||||
if (!data_v[i] && data[i] >= src && data[i] < src+rng) {
|
||||
data[i] = dst + (data[i] - src);
|
||||
data_v[i] = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user