Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!munnari.oz.au!bunyip.cc.uq.oz.au!zeus!s64421 From: s64421@zeus.usq.EDU.AU (house ron) Newsgroups: comp.lang.c Subject: Re: Borland C++ bug? Message-ID: Date: 20 Jun 91 12:04:47 GMT References: <1991Jun19.003026.21026@noose.ecn.purdue.edu> Lines: 21 del@percheron.ecn.purdue.edu (David A Whittemore) writes: >under borland C++ 2.0, however, the line: > sprintf(line, "%s %s", line, word); >acts like: > strcpy(line, word) ! >which means it wipes out the existing contents of "line". >is this a borland bug, or have i been making some bad >assumptions as to how sprintf() works for years? To quote the ANSI C standard, "If copying takes place between objects that overlap, the behaviour is undefined." -- Regards, Ron House. (s64421@zeus.usq.edu.au) (By post: Info Tech, U.C.S.Q. Toowoomba. Australia. 4350)