Skip to content

Commit

Permalink
Revert some minor changes
Browse files Browse the repository at this point in the history
This reverts commit dc81939.
  • Loading branch information
xyproto committed Feb 9, 2024
1 parent 737376f commit f679f23
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ int decode_hex_stream_normal(const int cols, const long base_off)
int c = 0, n1 = -1, n2 = 0, n3 = 0, p = cols;
long have_off = 0, want_off = 0;
rewind(input_file);
while (((c = getc(input_file)) != EOF) && (c != '\r')) {
while ((c = getc(input_file)) != EOF) {
if (c == '\r') { // DOS style newlines?
continue;
}
n3 = n2;
n2 = n1;
n1 = parse_hex_digit(c);
Expand All @@ -236,9 +239,9 @@ int decode_hex_stream_normal(const int cols, const long base_off)
if (p >= cols) {
if (n1 < 0) {
p = 0;
} else {
want_off = (want_off << 4) | n1;
continue;
}
want_off = (want_off << 4) | n1;
continue;
}
ignore = false;
Expand Down Expand Up @@ -294,9 +297,9 @@ int decode_hex_stream_bits(const int cols)
if (n1 < 0) {
p = 0;
bit_count = 0;
} else {
want_off = (want_off << 4) | n1;
continue;
}
want_off = (want_off << 4) | n1;
continue;
}
if (c == '\n') {
Expand Down

0 comments on commit f679f23

Please sign in to comment.