[Z88dk-commits] CVS: z88dk/libsrc/_DEVELOPMENT/stdio/z80 asm_vsscanf

Bridge to the z88dk-commits mailing list
Post Reply
alvin

[Z88dk-commits] CVS: z88dk/libsrc/_DEVELOPMENT/stdio/z80 asm_vsscanf

Post by alvin »

Update of /cvsroot/z88dk/z88dk/libsrc/_DEVELOPMENT/stdio/z80
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2157

Modified Files:
asm_vsscanf.asm
Log Message:
fake file struct on stack wasn't large enough so that stored string points overwrote ungetc indicator, which messed up scanning

Index: asm_vsscanf.asm
===================================================================
RCS file: /cvsroot/z88dk/z88dk/libsrc/_DEVELOPMENT/stdio/z80/asm_vsscanf.asm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** asm_vsscanf.asm 26 Mar 2014 05:30:45 -0000 1.6
--- asm_vsscanf.asm 28 Mar 2014 19:27:38 -0000 1.7
***************
*** 68,77 ****

push hl ; char *s is stored in the FILE *
! ld hl,$8000 + (sscanf_inchar / 256)
push hl
! ld hl,195 + ((sscanf_inchar % 256) * 256)
push hl

! ld ix,0
add ix,sp ; ix = sscanf FILE *

--- 68,79 ----

push hl ; char *s is stored in the FILE *
! ld hl,$0280
push hl
! ld hl,sscanf_inchar
! push hl
! ld hl,$c3c3
push hl

! ld ix,1
add ix,sp ; ix = sscanf FILE *

***************
*** 82,85 ****
--- 84,88 ----
pop bc ; repair stack
pop bc
+ pop bc
pop bc ; bc = char *s (next unexamined char)

***************
*** 110,115 ****
ld de,$ffff ; de = number of chars read - 1

! ld l,(ix+4)
! ld h,(ix+5)
dec hl ; hl = char *s - 1

--- 113,118 ----
ld de,$ffff ; de = number of chars read - 1

! ld l,(ix+5)
! ld h,(ix+6)
dec hl ; hl = char *s - 1

***************
*** 138,143 ****
return_unqualified:

! ld (ix+4),l
! ld (ix+5),h ; write char *s to file structure

ld l,a
--- 141,146 ----
return_unqualified:

! ld (ix+5),l
! ld (ix+6),h ; write char *s to file structure

ld l,a
***************
*** 170,180 ****
exx

! ld l,(ix+4)
! ld h,(ix+5) ; hl = char *s

call asm__memstrcpy

! ld (ix+4),l
! ld (ix+5),h ; update char *s

push bc
--- 173,183 ----
exx

! ld l,(ix+5)
! ld h,(ix+6) ; hl = char *s

call asm__memstrcpy

! ld (ix+5),l
! ld (ix+6),h ; update char *s

push bc
***************
*** 209,220 ****
ld b,h ; bc = seek forward length

! ld l,(ix+4)
! ld h,(ix+5) ; hl = char *s

call asm_strnlen
add hl,de ; hl = new char *s

! ld (ix+4),l
! ld (ix+5),h

exx
--- 212,223 ----
ld b,h ; bc = seek forward length

! ld l,(ix+5)
! ld h,(ix+6) ; hl = char *s

call asm_strnlen
add hl,de ; hl = new char *s

! ld (ix+5),l
! ld (ix+6),h

exx


------------------------------------------------------------------------------
Post Reply