Subj : Codeguard found error in sprintf() To : borland.public.cpp.borlandcpp From : "Richard Hufford" Date : Tue Feb 24 2004 06:17 pm I've just started using Codeguard to look for errors in my BC++ 5.01 program, and it found an error in one of my common uses of sprintf(). My code looks much like this: char buf[100]; char *r = new char[8]; strcpy (r, "richard"); sprintf (buf, "%25s", r); Codeguard gives this message: CodeGuard Error: Access overrun (thread 0x0114) Attempt to access 25 byte(s) at 0x014C63B4, that is at heap block 0x014C63B4 which is only 8 bytes long. Apparently, sprintf tries to access 25 characters pointed to by r. I assume sprintf is trying to read these characters, not write them, so this is not really a problem. Am I correct? .