Fixed Small bug in function "axtoi"

Status
Not open for further replies.

Ricardo

Dead Guybrush in netgames
Easily fixable.

src/p_spec.c, line 4887

The current code:
Code:
if (hexStg[n] > 0x29 && hexStg[n] < 0x40) // 0-9
Should be this instead:
Code:
if (hexStg[n] >= '0' && hexStg[n] <= '9') // 0-9
 
Last edited by a moderator:
I dunno, other axtoi implementations use the current code and I haven't heard any horror stories...
 
The thing is, the current code allows the use of ASCII characters 0x2A ('*') to 0x2F ('/') and 0x3A (':') to 0x3F ('?').
Such characters are being incorrectly interpreted as hexadecimal values A-F.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top