Permalink
Browse files

Merge branch 't/4f9d6407'

  • Loading branch information...
nickolasburr committed Nov 18, 2018
2 parents 4f9d640 + 4be887d commit a2656d7ecd85e2dafb4f5729e8c056a6a41b75da
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/main.c
@@ -9,7 +9,7 @@
int main (int argc, char **argv) {
int i, n;
int start, end, count;
int sets, index, zindex;
int pairs, index, zindex;
int opt_value, long_opt_index;
size_t len;
ssize_t read;
@@ -72,7 +72,7 @@ int main (int argc, char **argv) {
}
}

sets = 0;
pairs = 0;
ranges = ALLOC(sizeof(*ranges) * n);

for (index = 1; index < argc; index += 1) {
@@ -124,7 +124,7 @@ int main (int argc, char **argv) {
zindex++;
}

ranges[sets++] = rng;
ranges[pairs++] = rng;
}

break;
@@ -153,7 +153,7 @@ int main (int argc, char **argv) {
count = 1;

while ((read = getline(&line, &len, stream)) != -1) {
for (index = 0; index < sets; index += 1) {
for (index = 0; index < pairs; index += 1) {
if (count >= ranges[index]->start && (count <= ranges[index]->end || !ranges[index]->end)) {
fwrite(line, read, 1, stdout);
}
@@ -165,7 +165,7 @@ int main (int argc, char **argv) {
/**
* Run clean-up tasks.
*/
for (index = 0; index < sets; index += 1) {
for (index = 0; index < pairs; index += 1) {
FREE(ranges[index]);
}

@@ -177,7 +177,7 @@ int main (int argc, char **argv) {
/**
* Run clean-up tasks.
*/
for (index = 0; index < sets; index += 1) {
for (index = 0; index < pairs; index += 1) {
FREE(ranges[index]);
}

0 comments on commit a2656d7

Please sign in to comment.