From 52a11813a607c662847a1ef052ef914417145101 Mon Sep 17 00:00:00 2001 From: nfkd Date: Sat, 27 Jul 2013 13:43:30 -0300 Subject: [PATCH] styling --- testing/misc_tools.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/testing/misc_tools.c b/testing/misc_tools.c index 34d64bf4..dbaa8b3b 100644 --- a/testing/misc_tools.c +++ b/testing/misc_tools.c @@ -25,19 +25,16 @@ #include #include -#include //for sscanf +#include /* for sscanf */ -//TODO: rewrite +/* TODO: rewrite */ unsigned char * hex_string_to_bin(char hex_string[]) { size_t len = strlen(hex_string); unsigned char *val = malloc(len); char *pos = hex_string; - int i=0; - while(i < len) { + int i; + for(i = 0; i < len; ++i, pos+=2) sscanf(pos,"%2hhx",&val[i]); - pos+=2; - i++; - } return val; -} \ No newline at end of file +}