[BusyBox] bug#1205: BusyBox] bug#1205: mount handles links differently in 0.60

Tomi Ollila Tomi.Ollila at sonera.com
Wed Aug 8 01:45:02 UTC 2001


Tuesday Aug 7 11:24:56 -0600 2001 Matt Kraai <kraai at alumni.carnegiemellon.edu> wrote:
> On Tue, Aug 07, 2001 at 08:03:45PM +0400, Vladimir N. Oleynik wrote:
> > > 
> > > I don't think your code is legal.  According to the strcpy(3)
> > > manpage, the source and destination strings may not overlap.  Your
> > > use of strcpy(3) to cut characters from the string violates this
> > > restriction.
> > 
> > No, in this code all is used absolute correctly. 
> > overlap: if destination stored in/after source only.
> 
> Is there a specification which says this?  The glibc manual
> prohibits any overlap, and uses the case you mention as an
> example.
> 

IMO Matt's argument is correct. W/ strcpy the memory areas may not overlap.
the strcpy() function may be implemented (in different architectures) the
way it is most efficient: It may copy from end to beginning on one
platform, from beginning to end on another -- and perhaps using some
multiprocessimg/dma -trickery on some ultimate machine.

For overlapping copy there is memmove() available. It would be nice, if
there were functions like `strcpy_b2e()' and `strcpy_e2b()' so the
user could (on some low-level size/speed issue) to choose the exact
version he or she needs.


Tomi







More information about the busybox mailing list