Skip to content

Commit

Permalink
Changed how we fix hex_encode to match the other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-pearce committed Sep 19, 2015
1 parent 5c73c9e commit d101fdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/output_modules/module_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ int json_output_file_init(struct state_conf *conf, UNUSED char **fields,
return EXIT_SUCCESS;
}

char *hex_encode(char *packet, int buflen)
char *hex_encode(unsigned char *packet, int buflen)
{
char *buf = xmalloc(2*buflen + 1);
for (int i=0; i < buflen; i++) {
snprintf(buf + (i*2), 3, "%.2hhx", packet[i]);
snprintf(buf + (i*2), 3, "%.2x", packet[i]);
}
buf[buflen*2] = 0;
return buf;
Expand Down

0 comments on commit d101fdf

Please sign in to comment.