Skip to content

Commit 5bb3388

Browse files
committed
Fixed hex validate bug: allow lowercase a-f too
1 parent 6b6d84b commit 5bb3388

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/json_module.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7133,8 +7133,10 @@ pure function valid_json_hex(str) result(valid)
71337133
integer(IK) :: n,i
71347134

71357135
!an array of the valid hex characters:
7136-
character(kind=CK,len=1),dimension(16),parameter :: valid_chars = &
7137-
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']
7136+
character(kind=CK,len=1),dimension(22),parameter :: valid_chars = &
7137+
[ (achar(i),i=48,57), & ! decimal digits
7138+
(achar(i),i=65,70), & ! capital A-F
7139+
(achar(i),i=97,102) ] ! lowercase a-f
71387140

71397141
!initialize
71407142
valid = .false.

0 commit comments

Comments
 (0)