develooper Front page | perl.perl5.porters | Postings from July 2009

Re: [perl #67912] syswrite prints garbage if called with emptyscalar and non-zero offset

Thread Previous | Thread Next
From:
Zefram
Date:
July 27, 2009 06:40
Subject:
Re: [perl #67912] syswrite prints garbage if called with emptyscalar and non-zero offset
Message ID:
20090727134024.GA19181@fysh.org
Vincent Pit wrote:
>But I don't think >= should be replaced by >, because an offset of n is
>outside a string of length n.

Offset of n is acceptable with a string of length n as long as you're not
intending to read more than zero chars from it.  The proper conditions
for acceptability are:

	write_length >= 0
	offset >= 0
	offset + write_length <= string_length

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About