From: uz Date: Mon, 12 Nov 2012 23:07:02 +0000 (+0000) Subject: Fixed an error in calloc reported by Marc 'BlackJack' Rintsch. X-Git-Tag: V2.14~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e04f1d8cb0c13726c877766405993705005b1e22;p=cc65 Fixed an error in calloc reported by Marc 'BlackJack' Rintsch. git-svn-id: svn://svn.cc65.org/cc65/trunk@5932 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/calloc.s b/libsrc/common/calloc.s index 16d217553..2a66a7d1b 100644 --- a/libsrc/common/calloc.s +++ b/libsrc/common/calloc.s @@ -7,8 +7,8 @@ ; .export _calloc - .import _malloc, _memset - .import tosumulax, pushax, push0 + .import _malloc, __bzero + .import tosumulax, pushax ; ------------------------------------------------------------------------- @@ -35,21 +35,20 @@ cpx #0 bne ClearBlock cmp #0 - beq ClearBlock + bne ClearBlock ; We have a NULL pointer, bail out rts -; No NULL pointer, clear the block. memset will return a pointer to the +; No NULL pointer, clear the block. _bzero will return a pointer to the ; block which is exactly what we want. ClearBlock: jsr pushax ; ptr - jsr push0 ; #0 lda Size - ldx Size+1 ; Size - jmp _memset + ldx Size+1 ; Size + jmp __bzero .endproc