diff --git a/libsrc/common/getcwd.s b/libsrc/common/getcwd.s index dc1662e6d..b3cfbefcf 100644 --- a/libsrc/common/getcwd.s +++ b/libsrc/common/getcwd.s @@ -53,12 +53,10 @@ loop: inc ptr2 overflow: lda #ERANGE - sta __errno+1 - tax ; High byte of ERANGE is zero, return zero - rts - + jsr __seterrno ; Returns 0 in A + tax ; Return zero + rts + ; Success, return buf done: lda ptr1