mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-02-07 04:30:31 +00:00
Fix perror() issues.
perror() should write only a single new-line. Also, it should not write the prefix string, colon and space if the prefix string pointer is NULL or if it points to an empty string.
This commit is contained in:
parent
2be73c4e5d
commit
24ec2ae9bc
14
stdio.asm
14
stdio.asm
@ -2141,6 +2141,13 @@ s equ 4 string address
|
||||
tsc set up DP addressing
|
||||
phd
|
||||
tcd
|
||||
|
||||
lda s skip prefix string if it is NULL/empty
|
||||
ora s+2
|
||||
beq lb0
|
||||
lda [s]
|
||||
and #$00FF
|
||||
beq lb0
|
||||
|
||||
ph4 >stderr write the error string
|
||||
ph4 s
|
||||
@ -2151,7 +2158,7 @@ s equ 4 string address
|
||||
ph4 >stderr
|
||||
pea ' '
|
||||
jsl fputc
|
||||
ph4 >stderr write the error message
|
||||
lb0 ph4 >stderr write the error message
|
||||
lda >errno
|
||||
cmp #maxErr+1
|
||||
blt lb1
|
||||
@ -2164,12 +2171,9 @@ lb1 asl A
|
||||
lda >sys_errlist,X
|
||||
pha
|
||||
jsl fputs
|
||||
ph4 >stderr write lf, cr
|
||||
ph4 >stderr write lf
|
||||
pea 10
|
||||
jsl fputc
|
||||
ph4 >stderr
|
||||
pea 13
|
||||
jsl fputc
|
||||
|
||||
pld remove parm and return
|
||||
lda 2,S
|
||||
|
Loading…
x
Reference in New Issue
Block a user