Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!percheron.ecn.purdue.edu!del From: del@percheron.ecn.purdue.edu (David A Whittemore) Newsgroups: comp.lang.c Subject: Borland C++ bug? Message-ID: <1991Jun19.003026.21026@noose.ecn.purdue.edu> Date: 19 Jun 91 00:30:26 GMT Sender: root@noose.ecn.purdue.edu (ECN System Management) Reply-To: del@percheron.ecn.purdue.edu (David A Whittemore) Organization: Purdue University Engineering Computer Network Lines: 32 i often use sprintf() to append an existing char[] with another: char line[BIG ARRAY], word[SMALLER ARRAY]; until EOF fscanf(fp, "%s", word); sprintf(line, %s %s", line, word); under Microsoft 5.1 and all other (BSD/SYSV) compilers i have used this would logically append "line" with "word". 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". example: char jnk[100]; strcpy(jnk, "hello"); sprintf(jnk, "%s %s", jnk, "world"); yields (under borland): " world" is this a borland bug, or have i been making some bad assumptions as to how sprintf() works for years? ug. -david