diff --git a/src/debug_helpers.c b/src/debug_helpers.c index a461043..329fd64 100644 --- a/src/debug_helpers.c +++ b/src/debug_helpers.c @@ -4,12 +4,12 @@ * Use like this: * log_write(0, LOG_MAIN, "DEBUG: %s", string2hex(var, var_len)); */ -char * string2hex(unsigned char * input, size_t length) { +char *string2hex(unsigned char *input, size_t length) { const int growth = 3; - char * outstring = store_get(growth*length+1); - memset(outstring, 0, 3*length+1); - for (int i =0; i<length; i++) { - sprintf(outstring+i*growth, "%02x ", input[i]); + char *outstring = store_get(growth * length + 1); + memset(outstring, 0, 3 * length + 1); + for (int i = 0; i < length; i++) { + sprintf(outstring + i * growth, "%02x ", input[i]); } return outstring; }