summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 5e0c23bb3b..1a205eb21f 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -591,9 +591,9 @@ base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
cp = dest;
end = src+srclen;
while (src<end) {
- sprintf(cp,"%02X",*(const uint8_t*)src);
+ *cp++ = "0123456789ABCDEF"[ (*(const uint8_t*)src) >> 4 ];
+ *cp++ = "0123456789ABCDEF"[ (*(const uint8_t*)src) & 0xf ];
++src;
- cp += 2;
}
*cp = '\0';
}