Skip to content
  • Jeff King's avatar
    isxdigit: cast input to unsigned char · 50a71776
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Otherwise, callers must do so or risk triggering warnings
    -Wchar-subscript (and rightfully so; a signed char might
    cause us to use a bogus negative index into the
    hexval_table).
    
    While we are dropping the now-unnecessary casts from the
    caller in urlmatch.c, we can get rid of similar casts in
    actually parsing the hex by using the hexval() helper, which
    implicitly casts to unsigned (but note that we cannot
    implement isxdigit in terms of hexval(), as it also casts
    its return value to unsigned).
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    50a71776