Skip to content

Commit

Permalink
mishegos: Fix hex2bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw committed Oct 14, 2019
1 parent 0c1512d commit 3e162a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mishegos/mishegos.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ char *hexdump(input_slot *slot) {
}

void hex2bytes(uint8_t *outbuf, const char *const input, size_t input_len) {
for (size_t i = 0; i < input_len / 2; ++i) {
outbuf[i] = (input[i] % 32 + 9) % 25 * 16 + (input[i + 1] % 32 + 9) % 25;
for (size_t i = 0, j = 0; j < input_len / 2; i += 2, ++j) {
outbuf[j] = (input[i] % 32 + 9) % 25 * 16 + (input[i + 1] % 32 + 9) % 25;
}
}

Expand Down

0 comments on commit 3e162a0

Please sign in to comment.