~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c7c9ea
)
correct hex() for 0 length outputs
author
Richard Kettlewell
<rjk@greenend.org.uk>
Fri, 21 Sep 2007 22:31:34 +0000
(23:31 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Fri, 21 Sep 2007 22:31:34 +0000
(23:31 +0100)
lib/hex.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/hex.c
b/lib/hex.c
index
bd4774a
..
f37db11
100644
(file)
--- a/
lib/hex.c
+++ b/
lib/hex.c
@@
-33,6
+33,7
@@
char *hex(const uint8_t *ptr, size_t n) {
while(n-- > 0)
p += sprintf(p, "%02x", (unsigned)*ptr++);
+ *p = 0;
return buf;
}