Brad Roberts wrote:
Walter Bright wrote:strlen() is safe, while strcpy() and printf() are not.You sure? Does running beyond the bounds of the array if there's no null termination count as safe some how? :)
Yes. Memory safety is defined as being free of memory corruption errors. Simply reading memory out of bounds does not corrupt memory.
Note that it is ok for a memory safe program to generate a seg fault. printf() is not memory safe because of the %n format.
