diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-01-15 23:56:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-01-15 23:56:38 +0000 |
commit | 093d71762c9a80cccdd759c83731c014b53c4435 (patch) | |
tree | 5cd8454691ac044b68fa144ae51fa539664dbc45 /src/common | |
parent | 11ed4500ded3270ea376d75269200bb99574026e (diff) | |
download | tor-093d71762c9a80cccdd759c83731c014b53c4435.tar.gz tor-093d71762c9a80cccdd759c83731c014b53c4435.zip |
r11978@Kushana: nickm | 2007-01-15 18:54:25 -0500
Apparently, the OpenBSD linker thinks it knows C better than I do, and gets to call me names for having strcat and strcpy and sprintf in my code--whether I use them safely or not. All right, OpenBSD. You win... this round.
svn:r9360
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.c | 4 |
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'; } |