API improvements needed by freeradius
[trust_router.git] / common / tr_util.c
index 55cebeb..9562d9c 100644 (file)
@@ -42,9 +42,10 @@ void tr_bin_to_hex(const unsigned char * bin, size_t bin_len,
 {
   assert(hex_len >= 2*bin_len);
   while (bin_len >0) {
-    snprintf(hex_out, hex_len, "%2x", bin[0]);
+    snprintf(hex_out, hex_len, "%.2x", bin[0]);
     bin++, hex_out += 2;
     bin_len--;
     hex_len -= 2;
   }
 }
+