krb5 commit: Remove unneeded conditional in hex.c

Greg Hudson ghudson at mit.edu
Mon Mar 19 20:54:14 EDT 2018


https://github.com/krb5/krb5/commit/a9f9a68d21f8f06dd78b80208aee292d2266a85d
commit a9f9a68d21f8f06dd78b80208aee292d2266a85d
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Mar 19 12:23:19 2018 -0400

    Remove unneeded conditional in hex.c
    
    hex_digit() accepts bval as an unsigned parameter, so we don't need to
    test if bval >= 0.

 src/util/support/hex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/support/hex.c b/src/util/support/hex.c
index 4407ff9..cbd30d7 100644
--- a/src/util/support/hex.c
+++ b/src/util/support/hex.c
@@ -37,7 +37,7 @@
 static inline char
 hex_digit(uint8_t bval, int uppercase)
 {
-    assert(bval >= 0 && bval <= 0xF);
+    assert(bval <= 0xF);
     if (bval < 10)
         return '0' + bval;
     else if (uppercase)


More information about the cvs-krb5 mailing list