_Reported by: will on Thu Feb 7 10:16:52 2008 _
As reported by Ray Racine.
There is a fence post bug in get-string-n in portio.sch. The do loop reads a char on loop initialization and then one for count iterations. Therefore one more then count chars are consumed in the call to get-string-n.
See sample below. Notice '5' was skipped.
Larceny v0.961 "Fluoridation" (Feb 4 2008 23:49:20,
precise:Linux:unified)
larceny.heap, built on Mon Feb 4 23:53:29 EST 2008
ERR5RS mode (no libraries have been imported)
> (import (rnrs))
Autoloading (rnrs)
Autoloading (rnrs enums)
Autoloading (rnrs lists)
Autoloading (rnrs syntax-case)
Autoloading (rnrs hashtables)
Autoloading (rnrs arithmetic bitwise)
Autoloading (rnrs programs)
Autoloading (rnrs files)
Autoloading (rnrs io ports)
Autoloading (larceny deprecated)
Autoloading (rnrs conditions)
Autoloading (rnrs exceptions)
Autoloading (rnrs records syntactic)
Autoloading (err5rs records procedural)
Autoloading (rnrs records procedural)
Autoloading (rnrs control)
Autoloading (rnrs sorting)
Autoloading (rnrs bytevectors)
Autoloading (rnrs unicode)
> (import (rnrs io ports))
> (define ip (open-string-input-port "12345678"))
> (get-string-n ip 4)
"1234"
> (get-string-n ip 4)
"678"
_Reported by: will on Thu Feb 7 10:16:52 2008 _ As reported by Ray Racine.
There is a fence post bug in
get-string-n
inportio.sch
. Thedo
loop reads a char on loop initialization and then one forcount
iterations. Therefore one more thencount
chars are consumed in the call toget-string-n
.See sample below. Notice '5' was skipped.
Notice '5' was skipped.