Subj : Re: Codeguard found error in sprintf() To : borland.public.cpp.borlandcpp From : "Dieter" Date : Wed Feb 25 2004 03:03 pm > char buf[100]; > char *r = new char[8]; > strcpy (r, "richard"); > sprintf (buf, "%25s", r); Are you sure this is how you implemented this? There is really nothing wrong with the code above except that there is a lot of copy from heap to stack for no apparent reason. Just remember to delete r (delete [] r). Dieter .