mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-02-07 04:30:31 +00:00
Make strerror() return a valid error string for unknown errno values.
This is required by C99 and later.
This commit is contained in:
parent
2d20af84fd
commit
2be73c4e5d
@ -2946,7 +2946,7 @@ sys_errlist start
|
||||
dc a4'EEXISTS'
|
||||
dc a4'ENOSPC'
|
||||
|
||||
! Note: if more errors are added, change maxErr in perror().
|
||||
! Note: if more errors are added, change maxErr in perror() and strerror().
|
||||
|
||||
EUNDEF cstr 'invalid error number'
|
||||
EDOM cstr 'domain error'
|
||||
|
@ -17,6 +17,7 @@
|
||||
****************************************************************
|
||||
*
|
||||
String start dummy routine
|
||||
copy equates.asm
|
||||
|
||||
end
|
||||
|
||||
@ -888,6 +889,7 @@ lb2 sty set set the disp past the current disp
|
||||
****************************************************************
|
||||
*
|
||||
strerror start
|
||||
maxErr equ ENOSPC max error in sys_errlist
|
||||
|
||||
phb get the error number
|
||||
plx
|
||||
@ -897,7 +899,10 @@ strerror start
|
||||
phx
|
||||
phk use local data bank
|
||||
plb
|
||||
asl A compute the index
|
||||
cmp #maxErr+1
|
||||
blt lb1
|
||||
lda #0
|
||||
lb1 asl A compute the index
|
||||
asl A
|
||||
tay
|
||||
ldx sys_errlist+2,Y load the address
|
||||
|
Loading…
x
Reference in New Issue
Block a user