mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Fix tohexu/1 and tohexl/1
tohexu(16) or tohexl(16) will now crash, instead of evaluating to $G or $g.
This commit is contained in:
parent
df81862554
commit
b2511f15a0
1 changed files with 2 additions and 2 deletions
|
@ -1030,11 +1030,11 @@ urlencode(<<>>, Acc, _Plus, _Upper) ->
|
|||
|
||||
-spec tohexu(byte()) -> byte().
|
||||
tohexu(C) when C < 10 -> $0 + C;
|
||||
tohexu(C) when C < 17 -> $A + C - 10.
|
||||
tohexu(C) when C < 16 -> $A + C - 10.
|
||||
|
||||
-spec tohexl(byte()) -> byte().
|
||||
tohexl(C) when C < 10 -> $0 + C;
|
||||
tohexl(C) when C < 17 -> $a + C - 10.
|
||||
tohexl(C) when C < 16 -> $a + C - 10.
|
||||
|
||||
%% Tests.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue