mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2024-11-19 08:31:26 +00:00
Allow -2147483648 (LONG_MIN) as valid input to strtol(), not setting errno.
This is what other implementations do and seems to be the intent of the standards, although the wording isn't entirely clear.
This commit is contained in:
parent
14554fcdc7
commit
8490da9d85
@ -843,10 +843,16 @@ cn3 ph4 str save the starting string
|
||||
sta val
|
||||
txy see if we have an overflow
|
||||
bpl rt1
|
||||
ldy negative allow -2147483648 as legal value
|
||||
beq ov0
|
||||
cpx #$8000
|
||||
bne ov0
|
||||
tay
|
||||
beq rt1
|
||||
;
|
||||
; Overflow - flag the error
|
||||
;
|
||||
lda #ERANGE errno = ERANGE
|
||||
ov0 lda #ERANGE errno = ERANGE
|
||||
sta >errno
|
||||
ldx #$7FFF return value = LONG_MAX
|
||||
ldy #$FFFF
|
||||
|
Loading…
Reference in New Issue
Block a user