]> git.sur5r.net Git - cc65/commitdiff
Call __seterrno and save a few bytes.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Jun 2010 21:29:28 +0000 (21:29 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Jun 2010 21:29:28 +0000 (21:29 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4702 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/getcwd.s

index dc1662e6da15c66029ec361bdb0d491296791397..b3cfbefcff37d362a9e7d30aa36d92590567cf51 100644 (file)
@@ -53,12 +53,10 @@ loop:   inc     ptr2
 
 overflow:
         lda     #<ERANGE
-        sta     __errno
-        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