]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* sha-example.c (display_hex): Simplified by using printf better.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 22 Apr 2003 19:54:09 +0000 (21:54 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 22 Apr 2003 19:54:09 +0000 (21:54 +0200)
Rev: src/nettle/ChangeLog:1.191
Rev: src/nettle/sha-example.c:1.2

ChangeLog
sha-example.c

index 6b939b6ef345d6227ab3e87b032382f30b71ec99..de9b4a8d55bf765fd1b6ab99a7511212b84b86cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,12 @@
 2003-04-22  Niels Möller  <nisse@cuckoo.hack.org>
 
+       * sha-example.c (display_hex): Simplified by using printf better.
+
        * nettle.texinfo (Example): Use @verbatiminclude to include the
        example program.
 
        * sha-example.c: Example program, for inclusion in the manual.
+       Fixed bugs reported by Mark Arking.
 
 2003-04-14  Niels Möller  <niels@s3.kth.se>
 
index a4818460f01d4a7901cbb5519daee5c1f885def2..8f43496894e1e608601473ace85c8a07723d1982 100644 (file)
@@ -8,14 +8,11 @@
 static void
 display_hex(unsigned length, uint8_t *data)
 {
-  static const char digits[16] = "0123456789abcdef";
   unsigned i;
 
   for (i = 0; i<length; i++)
-  {
-    uint8_t byte = data[i];
-    printf("%c%c ", digits[(byte / 16) & 0xf], digits[byte & 0xf]);
-  }
+    printf("%2x ", data[i]);
+
   printf("\n");
 }